0

I'm not going into great detail but I need a way to make

/setblock ~ ~1 ~ chest 2 replace {CustomName:"yolo (1,2,3)",Items:[{id:25,Slot:13,Count:1,tag:{display:{Name:"2",Lore:["LOL"]}}}]}

I am wondering if I can do

/setblock ~ ~1 ~ chest 2 replace {CustomName:"yolo (1,2,3)",Items:[{id:25,Slot:13,Count:1,tag:{display:{Name:"2",Lore:["LOL"]}}}]},{CustomName:"yolo (1,2,3)",Items:[{id:25,Slot:14,Count:1,tag:{display:{Name:"3",Lore:["LOL"]}}}]},{CustomName:"yolo (1,2,3)",Items:[{id:25,Slot:13,Count:1,tag:{display:{Name:"1",Lore:["LOL"]}}}]}

but every single time I try to do it, it doesn't let me run the command (I try different ideas every time).

So can you please help me, I've been looking for this for AGES if you can it is greatly appreciated, and if not, thanks anyway.

1 Answer 1

2

The thing is, you can't just try different ideas every time. You have to understand the underlying structure of your command.
Now, your first command works fine, lets give it a bit more structure:

/setblock ~ ~1 ~ chest 2 replace {
  CustomName:"yolo (1,2,3)",
  Items:[
    {id:25,Slot:13,Count:1,tag:{display:{Name:"2",Lore:["LOL"]}}}
  ]
}

(This way it's infinitely more readable and easier to expand/debug. I suggest you write your commands in an external editor, like Notepad++, and copy them into minecraft.)
In your command you can see the word Items followed by brackets, indicating that it stores an array of data, which makes sense as we want to store multiple items in a chest. If you want to add more items, simply expand this list. But make sure to adjust the Slot value:

/setblock ~ ~1 ~ chest 2 replace 
{
  CustomName:"Chest-Title",
  Items:[
    {id:25,Slot:12,Count:1,tag:{display:{Name:"1",Lore:["LOL"]}}},
    {id:25,Slot:13,Count:1,tag:{display:{Name:"2",Lore:["LOL"]}}},
    {id:25,Slot:14,Count:1,tag:{display:{Name:"3",Lore:["LOL"]}}}
  ]
}
1
  • thanks so much, I don’t have any application remotely to notepad++ (or notepad for that matter) but I have completed my project and I am thanking you if you want what I created it has too many characters to fit into this little text box. and also I don’t randomly put it in I just have HEAPS of trouble reading brackets and ordering them, but that because when I focus on something I get really dizzy and have to go to bed, so i use an external application to check but thanks SO much!
    – user136192
    Commented Jan 17, 2016 at 2:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.