0

so, I kinda dunno how to put items into a command.

For example,

/give wchest 1 1 {detail:{name:"medical kit"}} {items: id:iron_sword {detail:{name: "scalpel"}}, slot: 0, count: 1} {items: id:paper {detail: {name: "paper towel"}}, slot: 1, count: 2}

2
  • Thankyou Virusbomb Jan 28, 2019 at 17:51
  • 3
    Where did you get any of this syntax from? I can immediately spot at least 10 syntax errors and I can't even figure out what you're trying to do. Let's start from the beginning: Do you want to place a new chest, modify an existing one or get an item for placing an already filled chest? You seem to have mixed up all three. Jan 28, 2019 at 18:44

1 Answer 1

2

An example to give yourself a chest with an item already inside it is as follows:

/give @p chest{BlockEntityTag:{Items:[{Slot:11b,id:"minecraft:stone",Count:1b}]}}
  • BlockEntityTag = What nbt the chest will have
  • Items = The items, how many items and the slot it's in.
  • Slot = The slot the item will be in. This ranges from 0-26.
  • id = The type of item.
  • Count = The number of items.

Slot, id and Count are all required, or it will not work.

To give yourself a chest with more items, you'll need add this after the first set of nbt within the square brackets:

,{Slot:12b,id:"minecraft:grass_block",Count:47b}

An example is as follows:

/give @p chest{BlockEntityTag:{Items:[{Slot:11b,id:"minecraft:stone",Count:1b},{Slot:12b,id:"minecraft:grass_block",Count:47b}]}}

These commands are for 1.13 Java Edition. Here is an example for 1.12:

/give @p chest 1 0 {BlockEntityTag:{Items:[{Slot:11b,id:"minecraft:stone",Count:1b}]}} 

Notice the only thing I changed is I put the count and the type before the nbt.

9
  • Thankyou so much Jan 28, 2019 at 18:39
  • Im sorry, I tested your command just to check through and understand it with your text, when I pressed the button nothing came into my hand. Jan 28, 2019 at 18:40
  • If 1.12.2 has anything to do with it, please tell me Jan 28, 2019 at 18:42
  • @DarkerPines The reason is because I used the @s selector, which will only work in a command block if you combine with execute. Replace it with @p (or @a or @r). I edited the answer to use @p instead. Jan 28, 2019 at 20:05
  • Your @p command still doesn't seem to work, any ideas? I will look over it. Jan 29, 2019 at 15:16

Not the answer you're looking for? Browse other questions tagged .