Place or Replace Single Blocks at Coordinates
The /setblock command lets you change a single block at a specific location in your Minecraft world into a different block. You can specify the exact coordinates and choose the block ID along with its block states and NBT data.
Players and map makers often use this command to automate building tasks, reset blocks in custom minigames, or clear single blocks by placing air. Because it modifies the world directly, you need Level 2 operator permissions or cheats turned on in single-player to run it.
/setblock <pos> <block>/setblock <pos> <block> destroy/setblock <pos> <block> keep/setblock <pos> <block> replace/setblock <pos> <block> strict/setblock <pos> <block>/setblock <pos> <block> destroy/setblock <pos> <block> keep/setblock <pos> <block> replace/setblock <pos> <block> strict| Argument | Type | What it means |
|---|---|---|
<pos> | block position | A block position made of three x y z coordinates, which can use ~ for relative positions or ^ for local positions. |
<block> | block | The block ID to place, optionally including block states in square brackets and NBT data. |
/setblock 100 64 -200 stonePlaces a stone block at the exact world coordinates 100, 64, -200.
/setblock ~ ~-1 ~ diamond_blockPlaces a diamond block directly beneath your feet using relative coordinates.
/setblock ^ ^ ^3 glassPlaces a glass block three blocks directly in front of where you are looking using local coordinates.
/setblock 0 70 0 oak_stairs[facing=east]Places oak stairs at 0, 70, 0 with the block state set so the stairs face east.
/setblock ~2 ~ ~ dirt keepPlaces a dirt block two blocks to the east of your current position using the keep option.
/setblock -50 65 120 glowstone destroyPlaces a glowstone block at -50, 65, 120 using the destroy option.
/setblock ~ ~1 ~ air replaceRemoves the block one space above your position by replacing it with air.
/setblock 15 80 -30 cobblestone strictPlaces a cobblestone block at 15, 80, -30 using the strict handling option.
Measured from the game files of every Java release from 1.13 to 26.3.
Bedrock Edition also includes the /setblock command, but it separates the block ID and block properties into distinct arguments: /setblock <position: x y z> <tileName: Block> <blockStates: block properties> [oldBlockHandling: SetBlockMode].
You need Level 2 operator permissions to run /setblock on a multiplayer server, or you must have cheats turned on in a single-player world.
The /setblock <pos> <block> strict syntax form was added in Minecraft Java Edition 1.21.5 and remains available in version 26.3.
You can append block states in square brackets directly to the block ID in the <block> argument, such as oak_stairs[facing=east].
/clone/difficulty/fill/fillbiome/forceload/gamerule/locate/place/seed/setworldspawn/time/waypoint/weather/worldborder