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

Attachments

Comments 9

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

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

Confirmed in 1.15.2 and 1.16 Release Candidate 1.

Confirmed just recently in 20w45a.

I just noticed when I used a spawn egg with "IsImmuneToZombification" for the piglin and hoglin, and instead of retaining itself as a hoglin/piglin, they turn into a zoglin/zombified piglin.

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

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

SystemUpdate

(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