-
Bug
-
Resolution: Cannot Reproduce
-
None
-
Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12.2, Minecraft 18w11a, Minecraft 1.13.1
-
Confirmed
-
(Unassigned)
Based on 1.11.2 decompiled using MCP 9.35 rc1
The bug
Mobs spawner create fake entities client-side if the mob to spawn overrides the method net.minecraft.entity.EntityLiving.onInitialSpawn(DifficultyInstance, IEntityLivingData) to spawn additional entites.
How to reproduce
- Place a spawner spawning zombies
/setblock ~ ~ ~ spawner{SpawnData:{id:"zombie"}}
- Place a repeating command block modifying the NBT data of the spawner
/data merge block ~ ~-1 ~ {NonExistentTag:1b}
- Go to 0, 0, 0
/tp 0 0 0
→ You will see multiple chicken jockeys
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The method net.minecraft.tileentity.MobSpawnerBaseLogic.getCachedEntity() calls the method net.minecraft.entity.EntityLiving.onInitialSpawn(DifficultyInstance, IEntityLivingData) when it creates the cached entity which is supposed to be rendered. The problem is that the onInitialSpawn method might spawn additional entities. Additionally this method displays variations of the mob which are not actually spawned because the call happens independently from the server and therefor the server might spawn other variations or multiple variations during one spawning cycle if the SpawnCount is higher than 1.
The expected behavior would be that the client does not call this method.