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
- Encase a chicken and place directly above it a repeating command block
teleport @e[type=zombie,distance=2..] ~ -255 ~
- 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
2017-02-19, 09:38 PM
2024-06-07, 02:02 AM
4
2
collision, mob-spawner, position, spawning, suffocate, suffocation
-