mojira.dev
MC-113937

Spawning collision checks are done before calling onInitialSpawn, making it impossible for baby mobs to spawn in smaller spaces

Based on 1.11.2 decompiled using MCP 9.35 rc1

The bug

The method net.minecraft.world.WorldEntitySpawner.findChunksForSpawning(WorldServer, boolean, boolean, boolean) which spawns mobs in the world and the method net.minecraft.tileentity.MobSpawnerBaseLogic.updateSpawner() which spawns a mob for a mob spawner call the method net.minecraft.entity.EntityLiving.isNotColliding() before calling the method net.minecraft.entity.EntityLiving.onInitialSpawn(DifficultyInstance, IEntityLivingData), which can make a mob be a baby. This makes it impossible for baby mobs to spawn in smaller spaces.

Note: Fixing this might break existing mob farms.

How to reproduce

  1. Create a Superflat world with the following preset

    minecraft:stone,minecraft:air,minecraft:glass;minecraft:plains;
  2. Set the time to night

    /time set 14000
  3. Use the /say command to list all zombies

    /say @e[type=zombie]

    → It won't find any zombies even though baby zombies would have enough space to spawn

Linked issues

Comments 2

Can confirm in 21w05b.

marcono1234

(Unassigned)

Confirmed

Mob spawning

baby, baby-mob, collision, mob-spawner, spawn, spawning

Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.13.2, Minecraft 19w08b, Minecraft 19w09a, Minecraft 19w11a, Minecraft 19w11b, 21w05b, 1.20.4, 1.21.5

Retrieved