How the Minecraft Setblock Command Works
The standard Java Edition syntax is /setblock <pos> <block> [destroy|keep|replace]. The first three values select a location; the block ID selects what to place; the mode determines what happens if a block is already there.
- Replace: puts the chosen block at the location.
- Keep: places the block only when the target space is air.
- Destroy: breaks the existing block before placing the new one.
Relative Coordinate Example
/setblock ~ ~1 ~ minecraft:glass replace
This places a glass block one block above the command executor. For a broader list of placeable entries, browse the Minecraft Block IDs page. For inventory items, switch to the Give Command Generator.