You've probably gotta use the CommonSetupEvent for this the server needs to know as well.
As long as you don't register the boss to spawn naturally then spawning it only when the player enters the structure should work no problems. It's just the Slime spawning mechanics(certain heights etc) are controlled by a custom function registered to a Map that is private in EntitySpawnPlacementRegistry.class. At least I couldn't find a way to register your own placement type for an entity.