mojira.dev
MC-31501

Cannot create chest with multiple items using /setblock

When trying to create a chest with multiple items using the following command:

/setblock ~0 ~0 ~2 minecraft:chest 0 replace {Items:[{id:274,count:1},{id:275,count:1}]}

Only the last item in the list is created in the chest. Works the same if I include the slot tag in each item definition.

Comments 6

I think this command is wrong, if I'm wrong correct me

If I take out the second item definition, it works just fine. I've tried different variations on including a second item in the list and they all error. This was the only one I could get to not error. If someone has the correct way for defining additional items to go in the chest, please let me know.

Of course, it doesn't help that the description field is formatting the command weirdly for me. That should be on one line if it doesn't show up that way.

You need the slot tag. Each item is {id:XXX,Count:1,Slot:X(0-9)}. (http://www.minecraftwiki.net/wiki/Player.dat_Format#Item_structure)

Adding the slot tag here does not fix the issue. When the slot tag is entered like this:

/setblock ~0 ~0 ~-2 minecraft:chest 0 destroy {Items:[{id:274,count:1,slot:1},{id:275,count:1,slot:2}]}

The chest is still created with only the last item in the list, not both.

Your issue is Case Sensitive.
Re-read Anon's post. Your string should read:

/setblock ~0 ~0 ~2 minecraft:chest 0 replace {Items:[{id:274,Count:1,Slot:0},{id:275,Count:1,Slot:1}]}

Note the "S" in Slot and "C" in Count must be capitalized

P.S. I have no idea how to make that box that keeps it nice and put together so sorry if it appears split.

Guess I should pay better attention. Thanks for your help, guys!

Robert Luman

(Unassigned)

Unconfirmed

chest, setblock

Minecraft 13w37b

Retrieved