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.
Linked issues
Attachments
Comments 9
Can confirm in 21w41a. The expected behavior would be that no sound is produced when summoning a mob with a spawn egg that has the "Silent:1b" tag.
Can confirm in 1.19.2. This ticket relates to MC-158168.
Hmm, I though we already had an report for this, but apparently not