Mojira Archive
MC-114018

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

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

Unresolved

Marcono1234

2017-02-19, 09:38 PM

2024-06-07, 02:02 AM

4

2

Confirmed

(Unassigned)

collision, mob-spawner, position, spawning, suffocate, suffocation

Minecraft 1.11.2 - 21w05bMinecraft 1.11.2, Minecraft 17w06a, 20w07a, 1.16.3, 21w05b

-