Setblock Generator
Placement
About the /setblock generator
The /setblock command places a single block at an exact position, optionally with block states and block entity data. It is the building block of almost every redstone contraption that has to modify the world, and it is far more predictable than placing blocks by hand when precision matters.
How to use this generator
Set the coordinates, choose the block, add any block states such as facing direction or open/closed, and pick a placement mode. Relative coordinates keep the command reusable when it is copied to a different location.
Things worth knowing
- The replace mode overwrites whatever is there; keep only places the block into air.
- The destroy mode drops the previous block as an item, which matters in survival contexts.
- Block states go in square brackets, for example minecraft:oak_stairs[facing=north,half=top].
- Block entity data such as chest contents or sign text is supplied separately from block states.
The generated command is produced entirely in your browser and nothing you enter is sent to EloTiers. Paste the result into the chat bar or a command block in your own world. If a command is rejected, check that the Minecraft version selected here matches the version you are actually running — the item and entity data format changed substantially in 1.20.5.
Worked examples
Place a single block
/setblock ~ ~ ~ minecraft:stonePuts stone at your own position, replacing whatever block was there.
A stair with a facing and half
/setblock ~ ~1 ~ minecraft:oak_stairs[facing=north,half=top]Block states go in square brackets. This stair is upside down and faces north, one block above you.
Only place into air
/setblock ~ ~2 ~ minecraft:glowstone keepWith the keep mode the command does nothing if the target position is already occupied, which protects existing builds.
Frequently asked questions
What is the difference between replace, destroy and keep?
Replace is the default and overwrites the block silently. Destroy breaks the old block as if a player mined it, so it drops its items. Keep only places the new block if the position is air.
How do I set a block at a precise location?
Use absolute coordinates, for example /setblock 100 64 -200 minecraft:stone. You can read your own coordinates from the debug screen opened with F3.
Why does the command fail outside loaded chunks?
Commands cannot change blocks in chunks that are not loaded. Move closer to the target or load the area first, for example with a forceload command.