Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-113937

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


    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.13.2, Minecraft 19w08b, Minecraft 19w09a, Minecraft 19w11a, Minecraft 19w11b, 21w05b, 1.20.4
    • Confirmed
    • Mob spawning

      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
      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

            Unassigned Unassigned
            marcono1234 Marcono1234
            8 Vote for this issue
            3 Start watching this issue