mojira.dev
MC-306690

Give command crashes when obtaining container with attribute_modifiers item inside

When using the /give command to obtain a container item (e.g. chest, shulker box) that contains an item with the attribute_modifiers component, the game throws an error (crash/console error) instead of granting the container as expected.

Reproduction Steps:

  1. Execute the /give command using a command block:
    give @a barrel[container=[{slot:0,item:{id:diamond_chestplate,count:1,components:{attribute_modifiers:[{type:armor,amount:1.0,operation:add_value,id:1772450770122}]}}}]]

  2. It will produce confusing error messages

Expected Behavior:
A barrel containing a diamond chestplate that grants 1 armor point appears in the player's inventory

Actual Behavior:
Command block throws an error, and the container is not given to the player

Environment

vanilla

Attachments

Comments 2

Thank you for helping us improve Minecraft! We saved your files:

[media]

Sorry I didn’t notice I wrote crash when I reviewed it again — the game does not crash

shao_B_

(Unassigned)

Unconfirmed

(Unassigned)

1.21.11

Retrieved