Changes a block to another block.
- Java Edition
setblock <pos> <block> [destroy|keep|replace]
- Bedrock Edition
setblock <position: x y z> <tileName: Block> [tileData: int] [destroy|keep|replace]
position: x y z)
- Specifies the position of the block to be changed. May use tilde and caret notation to specify a position relative to the command's execution.
- Specifies the new block. Must be a block id.
tileData: int[Bedrock Edition only]
- Specifies additional data to further describe the new block. Must be between 0 and 65535 (inclusive), but values that are invalid for the specified block id revert to 0. If not specified, defaults to
- 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
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.
/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
|1.11||16w32a||Added block state support to |
|Pocket Edition Alpha|
|0.16.0||build 1||Added |