/setblock Command in Minecraft Bedrock Edition

Change One Block Into Another Block

Bedrock EditionWorld & BlocksPermission: Game DirectorsCheats: YesJava version →

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.

Syntax (1 form)

  1. /setblock <position: x y z> <tileName: Block> <blockStates: block properties> [oldBlockHandling: SetBlockMode]

    Set block, block states

Arguments

ArgumentTypeWhat it means
blockStatesblock propertiesThe specific block properties, enclosed in brackets, that control the appearance or behavior of the block being set.
oldBlockHandlingSetBlockModeThe method used to handle the existing block (`destroy`, `hollow`, `keep`, `outline`, or `replace`), which defaults to `replace` if left blank.
position: x y zpositionThe X, Y, and Z coordinates that define the exact position of the block you want to change.
tileNameBlockThe internal name of the new block you want to place at the chosen coordinates.

Examples

Tips

Common mistakes

Bedrock vs Java

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.

See /setblock in Java Edition →

FAQ

Why does /setblock say cheats are not enabled?

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.

What is the difference between replace, keep, and destroy in /setblock?

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.

How do I delete a block using /setblock?

You can delete any block by running the /setblock command at its coordinates and using air as the new block name.

Related commands

/clone/daylock/difficulty/fill/fog/gamerule/locate/mobevent/place/setworldspawn/structure/tickingarea/time/weather

More on 9Minecraft