I tried to use the command setblock ~1 ~ ~ stone_button but then it places a button on air.

I'm running Minecraft 14w11b snapshot from the 1.8 snapshots.

Does someone know how to fix this?

Pictures below:



  • You need to also set the datavalue of the button, which corresponds to which face of the cube it attaches to. Unfortunately, I don't know what value will work for you off hand.
    – MBraedley
    Apr 11 '14 at 11:24
  • Just shift-click while placing the button on the command block. Apr 12 '14 at 19:01

You have to set the Datavalue of the button too, as this tells the button which direction to face. Luckily in the newest snapshots it is really easy to determine the correct datavalue by pressing F3, and then looking at the button you want to place.
The datavalue of the button
At the top right corner it says: Block: minecraft:stone_button/1 which you want to place. So the full command would be:

setblock ~1 ~ ~ minecraft:stone_button 1
  • What is this photo editor you are using?
    – 54D
    Aug 15 '15 at 11:11
  • I think I used Gimp for this one, but I am pretty sure you can do that with every major image editing program. Just select the area you want to keep, invert the selection, and reduce the brightness on the remaining area.
    – Lars
    Aug 15 '15 at 11:37

You should change the command to:

setblock ~1 ~ ~ stone_button 1

The datavalue is required to change which direction the button is facing, and thus what surface it is on:

1 = East, 2 = West, 3 = South, 4 = North, 5 = Up

You can also add 8 to any of those to turn it into a pressed button in the same direction.


setblock ~1 ~ ~ stone_button

In this case, the number represents a direction, relative to the command block.

  • 0 = DOWN
  • 1 = EAST
  • 2 = WEST
  • 3 = SOUTH
  • 4 = NORTH
  • 5 = UP.

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