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

EditionSyntax
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_block

Place a diamond block at those coordinates

/setblock ~ ~-1 ~ minecraft:glass

Put 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

Related commands

/fill/summon