Free browser tool

Minecraft Setblock Command Generator

Build a Java Edition /setblock command with coordinates, a modern block ID, and a placement mode. Copy it directly into Minecraft or a command block.

Catalog reference: Java Edition 26.2

Build Your /setblock Command

Generated command /setblock ~ ~ ~ minecraft:stone replace

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.