Change One Block Into Another Block
The /setblock command changes a single block at a specific coordinate into a different block in Minecraft Bedrock Edition. You can also control the block's properties and choose what happens to the block that was already there.
Players and map makers use this command to build custom redstone contraptions, create disappearing doors, reset mining areas, or place blocks in spots they cannot reach by hand.
/setblock <position: x y z> <tileName: Block> <blockStates: block properties> [oldBlockHandling: SetBlockMode]Set block, block states
| Argument | Type | What it means |
|---|---|---|
blockStates | block properties | The specific block properties, enclosed in brackets, that control the appearance or behavior of the block being set. |
oldBlockHandling | SetBlockMode | The method used to handle the existing block (`destroy`, `hollow`, `keep`, `outline`, or `replace`), which defaults to `replace` if left blank. |
position: x y z | position | The X, Y, and Z coordinates that define the exact position of the block you want to change. |
tileName | Block | The internal name of the new block you want to place at the chosen coordinates. |
/setblock 100 64 200 stoneReplaces whatever block is at coordinates 100, 64, 200 with a regular stone block.
/setblock ~ ~ ~ airRemoves the block directly at your feet by turning it into an air block.
/setblock ~ ~1 ~ torch [] keepPlaces a torch one block above you only if that space is currently empty.
/setblock -45 70 120 diamond_ore [] destroyBreaks the existing block at -45, 70, 120 so it drops as an item, and puts a diamond ore block in its place.
/setblock ~2 ~ ~-2 oak_log ["pillar_axis"="x"] replacePlaces an oak log sideways along the X axis at a relative offset from your current position.
/setblock 0 80 0 stone_slab ["stone_slab_type"="brick","top_slot_bit"=true]Places an upside-down brick slab in the top half of the block space at 0, 80, 0.
In Minecraft Java Edition, the command is simpler because block states are attached directly to the block name rather than listed as a separate argument, and the only old block handling modes available are destroy, keep, and replace.
The /setblock command requires cheats to be turned on in your world settings, and you must have the Game Directors permission level to use it.
The replace mode overwrites the old block silently, keep only places the new block if the space is currently air, and destroy breaks the old block with particles and item drops before placing the new one.
You can delete any block by running the /setblock command at its coordinates and using air as the new block name.
/clone/daylock/difficulty/fill/fog/gamerule/locate/mobevent/place/setworldspawn/structure/tickingarea/time/weather