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)
NBT: An Official PolyCoin
.