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

Mob spawners do not test if the entity to spawn collides after calling onInitialSpawn

XMLWordPrintable

    • Confirmed
    • (Unassigned)

      Based on 1.11.2 decompiled using MCP 9.35 rc1; Code analysis potentially outdated

      The bug

      Mob spawners do not test if the entity to spawn collides after calling net.minecraft.entity.EntityLiving.onInitialSpawn(DifficultyInstance, IEntityLivingData) (respectively the methods overriding it). This could result in mobs suffocating if the method onInitialSpawn changed their position.

      Note: For naturally spawned mobs this is tested.

      How to reproduce

      1. Encase a chicken and place directly above it a repeating command block
        teleport @e[type=zombie,distance=2..] ~ -255 ~
        
      2. Create a spawner 4 blocks horizontally away
        /setblock ~ ~ ~ spawner{MaxSpawnDelay:5s,MinSpawnDelay:5s,SpawnCount:255s,RequiredPlayerRange:16s,SpawnRadius:1s,MaxNearbyEntities:255s,SpawnData:{id:"zombie"}}
        

        At some point a baby zombie starts riding the chicken even if there is not enough space above causing the zombie to suffocate

            Unassigned Unassigned
            marcono1234 Marcono1234
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: