Minecraft 1.14 How to summon a chest with nbt tag items inside
We are trying to /setblock
a chest with a command block that has an item in slot 13 with the following properties.
- Name: 5 point PolyCoin
- NBT: An Official PolyCoin
- Has to have an enchanted glow to it.
The chest should appear at 9 2 8 in the world.
We have tried dozens of things from online, here are two of them:
/setblock 9 2 8 chest{Items:[{id:gray_dye,Damage:8,Slot:13,Count:1,display:{Name:5 Point PolyCoin,Lore:[Official PolyCraft Coins] } } ]}
/setblock 9 2 8 chest{Items:[{Slot:13,id:gray_dye,Count:1,tag:{Enchantments:[{id:fortune,lvl:3}]}}]} replace
Both only place a chest with a piece of gray dye inside.
You can get a /setblock
command with F3+I.
To do so, you place a chest at 9 2 8
(This works for any block at any coordinates).
Then you fill the chest with the items that you want inside of it:
You can get gray dye like the one from the image with this command:
/give @s minecraft:gray_dye{Enchantments:[{id:"minecraft:fortune",lvl:3s}],display:{Name:'{"text":"5 Point PolyCoin"}',Lore:['{"text":"An Official PolyCoin"}']}}
When you are done, you look at it and press F3+I, there should be a message in chat:
You can now paste your command into a command block, or a text editor by using Ctrl+V (in windows):
/setblock 9 2 8 minecraft:chest[facing=north,type=single,waterlogged=false]{Items:[{Slot:13b,id:"minecraft:gray_dye",Count:1b,tag:{Enchantments:[{lvl:3s,id:"minecraft:fortune"}],display:{Lore:['{"text":"An Official PolyCoin"}'],Name:'{"text":"5 Point PolyCoin"}'}}}]}
You can edit the command, to make it a little shorter, by removing tags that you don't need, if you care about that (This may be more useful with different blocks):
/setblock 9 2 8 minecraft:chest{Items:[{Slot:13b,id:"minecraft:gray_dye",Count:1b,tag:{Enchantments:[{lvl:3s,id:"minecraft:fortune"}],display:{Lore:['{"text":"An Official PolyCoin"}'],Name:'{"text":"5 Point PolyCoin"}'}}}]}
Once you are done you can break the block that you made and use the command to set your custom block at that position. (This works for entities, too, simply look at the entity to get a /summon
command with F3+I)