Refilling a chest with "special" item [duplicate]

Refilling a chest with "special" item [duplicate] - Free stock photo of antique, architecture, candle

I have this command:

/summon FallingSand ~1 ~ ~ {TileID:54,Time:0.9,TileEntityData:{Items:[{id:stained_glass,Slot:1,Count:1}]}}

I want to add this item command in replace of the stained_glass:

/give @a minecraft:stained_glass 4 {CanPlaceOn:["minecraft:iron_block"]}

So, in the chest there will be stained glass color yellow, that can only be placed on an iron block in Adventure mode. How can I do this?



Best Answer

The tag compound holds item data that is not the root id, Damage, Count, or Slot tags. The Damage tag will state the color of the glass.

You should also not be using the TileID tag because it is deprecated. Use Block instead, which holds the string name of the block. The Time tag is an integer, not a double, so you cannot use decimals.

/summon minecraft:falling_block ~1 ~ ~ {Block:"minecraft:chest",Time:1,TileEntityData:{Items:[{id:"minecraft:stained_glass",Damage:4,Slot:1,Count:1,tag:{CanPlaceOn:["minecraft:iron_block"]}}]}}



Pictures about "Refilling a chest with "special" item [duplicate]"

Refilling a chest with "special" item [duplicate] - Girl with a Phrase on her T-shirt
Refilling a chest with "special" item [duplicate] - Light Inside Chest Box
Refilling a chest with "special" item [duplicate] - Young woman watching movie in headphones in messy room



How do you duplicate items with chests?

TIL in Creative mode, you can use Ctrl+Mouse3 to copy a container and its contents [14w11b/1.8]

How do you copy a filled chest in Minecraft?

Whilst filling the dispensers I discovered that if I hold Shift and then double click a stack of items the game will transfer every single one of that item into the container.



CHEST REFILL! - Command Block Tutorial!




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Karolina Grabowska, Karolina Grabowska, David Bartus, Andrea Piacquadio