/setblock ~ ~ ~ minecraft:stone replaceUse ~ for relative, ^ for local coordinates, or absolute numbers.
Selected:
minecraft:stone
The /setblock command places a single block at an exact X, Y, Z coordinate in your Minecraft world. This generator builds the correct syntax for any block, with block state options and placement modes, ready to paste into chat or a command block.
The syntax is /setblock <pos> <block> [destroy|keep|replace]. You provide coordinates, a block ID, and optionally a placement mode. The command works in singleplayer with cheats enabled, on multiplayer servers with operator permissions, and inside command blocks for automation.
Where /setblock really shines is precision work: placing a single block in an exact spot or swapping one block in a build without breaking its neighbors. For filling larger areas, pair it with the /fill command instead.
The placement mode controls what happens to the block already at the target position. Each mode behaves differently:
| Mode | Behavior | Drops Items | Best For |
|---|---|---|---|
| replace | Silently overwrites the existing block | No | Clean block swaps, building |
| destroy | Breaks the existing block as if mined by a player | Yes | Simulating block breaks, resource farming |
| keep | Only places block if position is air or fluid | No | Filling gaps without overwriting builds |
Tip: the destroy mode plays the block-breaking sound and spawns break particles. If you run setblock in a rapid loop via command blocks, this can cause lag. Use replace for silent, performance-friendly placement.
Many blocks have configurable states. Block states are appended in square brackets after the block ID. Here are the most common state properties:
| Property | Values |
|---|---|
| facing | north, south, east, west (+ up/down for some) |
| half | top, bottom (or upper, lower for doors) |
| axis | x, y, z |
| type | top, bottom, double (slabs) |
| shape | straight, inner_left, inner_right, outer_left, outer_right (stairs) |
| lit | true, false |
| powered | true, false |
Example: /setblock ~ ~ ~ oak_stairs[facing=east,half=top,shape=straight] places oak stairs facing east on their top half. Append the states you need after the block ID, separated by commas.
It places a single block at a specific X, Y, Z coordinate. You choose a block from the Java Edition registry, configure optional block states, and select a placement mode (destroy, keep, or replace). It requires cheats or operator permissions to use.
Replace (default) silently swaps the existing block. Destroy breaks the existing block as if mined, dropping items and playing the break sound. Keep only places the block if the target position contains air or a fluid.
Yes. Use the tilde (~) prefix for coordinates relative to the executor's position. For example, /setblock ~ ~-1 ~ stone places stone one block below you. You can also use caret (^) notation for local coordinates based on your facing direction.
Append states in square brackets after the block ID: /setblock ~ ~ ~ oak_stairs[facing=east,half=top]. Many blocks have configurable states including facing, half, axis, shape, and powered.
Browse more Minecraft tools: