mojira.dev
MC-139449

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.

Linked issues

Attachments

Comments 9

Hmm, I though we already had an report for this, but apparently not

Can confirm in 21w05b.

Can confirm in 21w06a.

Can confirm in 1.16.5 and 21w08b. Video attached.

Can confirm in 1.17.

Can confirm in 1.17.1.

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.18.2 and 22w18a.

Can confirm in 1.19.2. This ticket relates to MC-158168.

Blue_future

(Unassigned)

Confirmed

Entities, Sound

silent, spawn_egg

Minecraft 1.13.2, Minecraft 18w45a, Minecraft 18w46a, Minecraft 18w48a, Minecraft 18w48b, ..., 1.18.2, 22w18a, 1.19.2, 1.20.1, 1.20.4

Retrieved