Minecraft Command Block Problem

minecraft-commandsminecraft-java-edition

I have an alarming and one annoying Minecraft 1.8.8 command that is to summon a item in a chest with another command of [CanPlaceOn]. This "[CanPlaceOn]" command is a command that allow certain things (blocks) to be placed on certain blocks! So when I am in adventure mode I can place the block that has the NBT tag of CanPlaceOn on a certain block. It would be helpful if someone could please provide the command for summoning a button in a chest that has the NBT CanPlaceOn tag.

Best Answer

Use

/blockdata x y z {Items:[0:{id:minecraft:wooden_button,tag:{CanPlaceOn:["minecraft:stonebrick"]},Count:1}]}

Which can add to an already filled chest. Replace x y z with the coordinates.


The /blockdata command changes, well, the data of a block (go figure!) Basically, I change the data of a chest to include a wooden button with the tag CanPlaceOn. Pretty simple, really.