-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[1.16.2] Setting mob spawns with WorldEvent.PotentialSpawns doesn't work. #7309
Description
Minecraft Version: 1.16.2
Forge Version: 33.0.22
Steps to Reproduce:
- Register a listener to
WorldEvent.PotentialSpawns - Modify the spawn list to only contain a non-vanilla spawn entry.
- Observe as no mobs are able to spawn.
Description of issue:
When trying to set mob spawns using WorldEvent.PotentialSpawns, any mobs set that are not the default for the area in question are not spawned. This is caused by WorldEntitySpawner.func_234976_a_ returning false if the mob spawner in question is not one of the normal ones for the area, preventing mobs from spawning where it gets called. A simple fix would be to return true here instead of doing the check since, as far as I can tell, it has no apparent actual function. Of course an event could be added to let modders validate spawns manually.
Here's a code block for an event if you want to copy and paste it for testing.
public void potentialSpawnsEvent(WorldEvent.PotentialSpawns event) { event.getList().clear(); event.getList().add(new MobSpawnInfo.Spawners(EntityType.ZOMBIFIED_PIGLIN, 1, 4, 4)); }