I am working on a chest menu. In the chest I have 2 full sets of armor. When someone clicks one part of the armor it must be replaced with enchanted armor. I tried /blockdata 6 11 -13 {Items:[0:{},1:{},2:{},3:{},4:{},5:{Slot:23b,id:minecraft:iron_boots,Count:1b}]} which laced the item just in the 5th slot. I also tried /blockdata 6 11 -13 {Items:[5:{Slot:23b,id:minecraft:iron_boots,Count:1b}]} which was then changed in the command block to [0:{...}].

Thanks.

enter image description here


Solution 1:

Use the replaceitem command. For example to replace the slot 23 with iron_boots the command should be:

/replaceitem block 6 11 -13 slot.container.24 iron_boots 1

Click here for more info on replaceitem.