mojira.dev
MC-98154

Spawn egg entity data gets ignored when creating a baby mob

If you use a spawn egg that has custom minecraft:entity_data set, usually it will summon a mob with that entity data. However, if you use the spawn egg on an adult mob, it will just spawn the baby variant of that mob without any of the custom entity data.

To reproduce

  1. Give yourself a spawn egg with custom NBT:

    /give @s minecraft:sheep_spawn_egg[minecraft:entity_data={id:"minecraft:sheep",CustomNameVisible:1b,CustomName:'{"text":"jeb_"}'}]
  2. Use the spawn egg on a block. This will summon a sheep named "jeb_"

  3. Use the spawn egg while looking at the sheep you just summoned

Observed behaviour

A new baby sheep is summoned. The baby sheep does not have a custom name.

Expected behaviour

A new baby sheep is summoned. The baby sheep is named "jeb_".

Linked issues

MC-260710 Spawn Egg with EntityTag can't summon mob with NBT correctly in some cases Resolved MC-276521 Piglins and Hoglins that are unable to Zombify don't pass on the NBT tag to babies Resolved MC-272659 Entity data is no longer applied to baby mobs spawned by using a spawn egg on an adult mob Resolved MC-208731 After obtaining a spawn egg for piglins that shouldn't zombify, placing the first piglin works as intended. But when placing the egg on another piglin to create a baby piglin, the piglin will become a zombie piglin if this happens in the overworld. Resolved MC-302262 Spawn eggs don't retain entity_data when used inside an existing mob Resolved

Attachments

Comments 12

It's more than that actually: the entirety of EntityTag is ignored.

oh wow, that's bad

I think it's fixed in 1.10. I tried using a husk spawn egg with a command and any baby zombies are spawned as baby husks.

Affects 1.10.

/give @p minecraft:spawn_egg 1 0 {EntityTag:{CustomName:Dave,id:Sheep,Color:3}}

Can confirm for 19w11a

2 more comments

Confirmed for 21w08a

Can confirm in 1.18.1. Executing the Command provided below to reproduce.

/give @s minecraft:sheep_spawn_egg{EntityTag:{CustomName:'{"text":"jeb_"}'}} 1

This still happens in 1.21.9

Can Confirm in 26.1 Snapshot 7, it’s time to fix it.

Still happens on 26.2-pre-2

migrated

(Unassigned)

Confirmed

Platform

Low

Commands

EntityTag, spawn_egg

Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.10, Minecraft 1.12.1, Minecraft 19w11a, , 1.20.6, 1.21 Pre-Release 1, 1.21 Pre-Release 2, 1.21.1, 24w36a

Retrieved