mojira.dev
MC-276275

Thrown projectiles (snowballs/eggs) do not correctly use new "entity_data" data component

entities with spawning items (such as armor stands) can no longer inherit NBT tags from the item, and instead use the "entity_data" component to specify NBT data explicitly. Thrown items, however, such as eggs and snowballs, do not benefit from this. 

To confirm that armor stands etc use "entity_data" as intended: 
1. /give @s armor_stand[entity_data={id:armor_stand,NoBasePlate:1b}]
2. place the armor stand in the world.
3. Note that the NoBasePlate tag has properly applied.

To confirm that certain NBT tags, such as the "Item" tag, work with thrown projectiles:

1. /summon egg ~ ~ ~ {Item:{id:diamond_sword,count:1}}
2. Note that the Item tag has been properly applied.

steps to reproduce:
1. give the player a snowball/egg with the "entity_data" tag, i.e:
      /give @p egg[entity_data={id:egg,Item:{id:diamond_sword,count:1}}]
2. use/throw the item. 
3. note that the Item tag has NOT properly applied.

Attachments

Comments 2

I am unsure if this constitutes your issue being invalid so I will not claim such, but this command leads to the result you expected:

/give @p egg[minecraft:entity_data={Item:{count:1,id:"diamond_sword"},id:"egg"},minecraft:item_model="minecraft:diamond_sword"]
[media]

I'm confused here how I would know if the projectile uses the data component correctly. Please can you elaborate?

Sky Shap

(Unassigned)

Unconfirmed

(Unassigned)

1.21.1

Retrieved