Minecraft /setblock command
Java EditionBedrock EditionSince 1.7.2 (13w37a)
Quick answer: Places a single block at exact coordinates. Syntax:
/setblock <pos> <block> [destroy|keep|replace]/setblock changes one block at the given position to any block you name. Modes: replace (default, swaps any block), keep (only fills air), destroy (breaks the old block and drops it).
Syntax
| Edition | Syntax |
|---|---|
| Java | /setblock <pos> <block> [destroy|keep|replace] |
| Bedrock | /setblock <position: x y z> <tileName: Block> [blockStates: block states] [oldBlockHandling: SetBlockType] |
Targets / arguments: one block position. Requires: Cheats enabled / operator level 2.
Examples
/setblock 100 64 200 minecraft:diamond_blockPlace a diamond block at those coordinates
/setblock ~ ~-1 ~ minecraft:glassPut a glass block directly under your feet
/setblock 0 80 0 minecraft:chest{Items:[{id:"minecraft:diamond",count:64,Slot:13}]}Chest pre-filled with diamonds (Java NBT)
Tips
- Use ~ ~ ~ for your own position, ~ ~-1 ~ for the block under you.
- Chain it in command blocks with /fill for scripted builds; /fill is faster for volumes.