0

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?

3

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 FallingSand ~1 ~ ~ {Block:"minecraft:chest",Time:1,TileEntityData:{Items:[{id:"minecraft:stained_glass",Damage:4,Slot:1,Count:1,tag:{CanPlaceOn:["minecraft:iron_block"]}}]}}
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.