Have you ever wanted to give you or your friends a kit, or something of that sort? Well usually people say you can do that easily, by lining up about 10 command blocks and taking an hour to set it up not to mention the amount of room it takes up... Well anyway, there's a solution! By using the tag "BlockEntityTag" you can /give a chest that appears in the inventory and has items inside when placed! Lets get to it.
The command is /give @p chest 1 0 {BlockEntityTag:{Items:[{id:#,Count:#,Slot:#}]}} After id, you enter the name of the item you want, and you can also specify how many you want, and what slot it appears in! You can also add "tag" after the slot, but we'll get to that after the examples. /give @p chest 1 0 {BlockEntityTag:{Items:[{id:diamond_sword,Count:1,Slot:0}]}} This will give you a chest, which contains a diamond sword in the very first slot. NOTE: tools and other usually singular items can come in stacks. When you separate the stack though, it can't be put back together again. :( Next I'll show you named items in a chest. /give @p chest 1 0 {BlockEntityTag:{Items:[{id:stick,Count:1,Slot:0,tag:{display:{Name:"Pointy Stick",Lore:["Very sharp,","Very pointy!"]},ench:[{id:16,lvl:10},{id:20,lvl:1},{id:21,lvl:5}]}}]}} This will give a stick with sharpness, fire aspect and looting on, as shown.
As you can see, the Pointy Stick has sharpness 10, fire aspect 1 and looting 5, and is located in slot 0 of the chest. Okay, so a re-cap. The tags that can be included in the "items" are:
id
Count
Slot
tag
Case sensitive. So you can choose the item, how many there are, which slot it's in, and then the item tags on top of that. The next bit we're going to cover is the count. Most things stack up to 64, and some 16. Tools though, are singular. The same goes for potions and enchanted books.
The command that was entered to get this was /give @p chest 1 0 {BlockEntityTag:{Items:[{id:diamond,Count:128,Slot:1},{id:egg,Count:64,Slot:3},{id:iron_hoe,Count:32,Slot:5},{id:diamond_axe,Count:128,Slot:7}]}}
Any more than 64 on any item will come up like the diamonds and the axes. The red items cannot be moved, and when the chest is broken they will disappear. Eggs can be stacked, as well as snowballs and other usually non stacking items. Whenever you separate them, they will not re stack any higher than their usual amount. If you have any questions let me know and if you have anything to add, leave it in the comments! Thank you and don't forget to check out our YouTube channel!
Any idea how to combine spawn_eggs and chests to produce/give a chest with a variety of spawn eggs inside???
Reply
Angel
3/14/2015 10:54:23 am
If you use the /give command and add the tag "Damage", then you can specify certain types of spawn eggs in the chest. So using the numbers in the other article, do
/give @p chest 1 0 {BlockEntityTag:{Items:[{id:spawn_egg,Count:#,Slot:#,Damage:#}]}}
So an example: (creeper spawn egg)
/give @p chest 1 0 {BlockEntityTag:{Items:[{id:spawn_egg,Count:1,Slot:0,Damage:50}]}}
Hope this helped!
Reply
sup dudes!
6/9/2017 12:35:00 am
i dont really get actually its to hard to memorise
Reply
Joseph Forney
11/24/2017 08:20:19 pm
Is there any way to do the same thing, but with other containers/anything with an item slot? For example the dispensers, hoppers, anvils, etc. And potentially containers from mods and/or addons?
Reply
Gabrielle
1/10/2020 08:53:00 pm
Does anyone know if this will work in 1.15. I am planning on making kits but it doesn't seem to be working at the moment. Thanks for the help