Summoning a mob with a "Silent" NBT tag using a spawn egg plays the ambient sound of the mob
The bug
Using a spawn egg with Silent:1b in the EntityTag plays the ambient sound when the mob is spawned.
How to reproduce
/give @s pig_spawn_egg{EntityTag:{Silent:1b}}
→
The pig plays the entity.pig.ambient sound once and only then turns silent
Code analysis
Based on 1.13.1 decompiled using MCPConfig.
The method EntityType.create(World, NBTTagCompound, ITextComponent, EntityPlayer, BlockPos, boolean, boolean) plays the ambient sound before applying the NBT data, which would prevent playing the sound.
2018-11-16, 11:23 AM
2023-12-11, 04:04 PM
12
2
-