Minecraft – can i put 3 items in a chest that are renamed, have lures, also the chest is renamed

minecraft-commandsminecraft-java-edition

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.

Best Answer

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"]}}}
  ]
}