From Minecraft Wiki
Jump to: navigation, search


First introduced

Java Edition 1.7.2 (13w37a)
PE Alpha 0.16.0 (PE Alpha 0.16.0 build 1)

Changes a block to another block.

  • Java Edition
setblock <pos> <block> [<mode>]
setblock <pos> <block>[state=value] [<mode>]
setblock <pos> <block>{tag:value} [<mode>]
setblock <pos> <block>[state=value]{tag:value} [<mode>]
where state is the name of the block state, and value is that block state's value (see Block states). Multiple block states and their values can be included, separated by a comma. (For example, minecraft:furnace[lit=true,facing=south])
  • Bedrock Edition
setblock <position: x y z> <tileName: Block> [tileData: int] [replace|destroy|keep]
x y z (BE: position: x y z)
Specifies the position of the block to be changed. May use tilde notation to specify a position relative to the command's execution.
block (BE: tileName: Block)
Specifies the new block. Must be a block id (for example, minecraft:stone or stone).
tileData: int (optional)‌[Bedrock Edition only]
Specifies additional data to further describe the new block. Must be between 0 and 15 (inclusive). If not specified, defaults to 0.
oldBlockHandling or mode (BE: replace|destroy|keep) (optional)
Specifies how to handle the block change. Must be one of:
  • destroy — The old block drops both itself and its contents (as if destroyed by a player). Plays the appropriate block breaking noise.
  • keep — Only air blocks are changed (non-air blocks are unchanged).
  • replace — The old block drops neither itself nor any contents. Plays no sound.
If not specified, defaults to replace.
Fails if the arguments are not specified correctly, if tried to change a non-air block in keep mode, tried to replace a block with an identical copy in keep or replace mode, or if the coordinates are in an unloaded chunk.
On success, changes the block at the specified position.
See also
  • /data — modifies the data tags of a block or entity
  • /clone — copies blocks from one region to another
  • /fill — fills a region with a block


Java Edition
1.7.213w37aAdded /setblock.
1.1116w32aAdded block state support to /setblock.
Pocket Edition Alpha
0.16.0build 1Added /setblock.