I have used /setblock to spawn a chest with an enchanted diamond with a custom name and lore. It spawns fine, but when I take the diamond out and try to throw it (I was trying to throw it into a hopper to trigger other command blocks.) it disappears and is nowhere to be found. The item also disappears if I try to put it in a container. This also happens with blocks that have been renamed using commands. The block cannot be placed and disappears upon right clicking. I am unsure if this is intended, but it seems as though it would be a bug. I'm sorry if this is a duplicate, I couldn't find any thing like it.
This the exact command:
setblock ~1 ~ ~3 minecraft:chest 0 replace {CustomName:"Magic Chest",Items:[{Slot:13,id:264,tag:{display:{Name:"Magic Diamond",Lore:["Use to activate"]},ench:[{id:49,lvl:1}]}}]}
Comments 6
It's not a matter of renaming, even
setblock ~1 ~ ~3 minecraft:chest 0 replace {Items:[{Slot:13,id:264}]}
shows the same behaviour.
Its your formating... I found this out on MC-31501. rewrite your code like this. All I did was put id before Slot and added a Count of 1
setblock ~0 ~0 ~-2 minecraft:chest 0 replace {CustomName:"Magic Chest",Items:[{id:264,Count:1,Slot:13,tag:{display:{Name:"Magic Diamond",Lore:["Use to activate"]},ench:[{id:49,lvl:1}]}}]}
It no longer dissapears for me and I can throw it. Something in the code makes it a ghost if its not typed in completely... Definitley something that needs to be fixed. It may only need the Count btw.
The count tag is needed.
That works:
setblock ~1 ~ ~3 minecraft:chest 0 replace {Items:[{id:264,Count:1,Slot:13}]}
Please attach the exact commands you're using (enclosed by
{code}
tags)