How to place a block with a command — the /setblock command

Generator /setblock

Place a block at coordinates — adjust the parameters and copy the finished result

The /setblock command places a single block at the specified coordinates. Use ~ for relative coordinates.

Coordinates

X
Y
Z

Use ~ for relative coordinates

Block

Mode

Generated command

>/setblock ~ ~ ~ minecraft:stone replace

Paste it into the Minecraft chat (the T key) or a command block

How does /setblock work?

The /setblock command places a single block at the specified coordinates. Syntax: /setblock <x> <y> <z> <block> [mode]. Modes: replace (replacement, default), destroy (with drops), keep (only if air).

Relative coordinates

Use ~ for relative coordinates: /setblock ~ ~-1 ~ minecraft:diamond_block — places a diamond block under your feet. ~1 ~0 ~0 — one block to the east.

Placement modes

replace — replaces any block. destroy — destroys the existing block with a drop, then places the new one. keep — places the block only if there is air in that spot (does not replace existing blocks).

Removing blocks

To remove a block, place air: /setblock <x> <y> <z> minecraft:air. This works with any blocks, including bedrock and barriers, which cannot be broken in survival.

10% off with promo code

Looking for Minecraft server hosting?

Launch your server in a minute — one-click mod and plugin installation, DDoS protection, powerful hardware. Promo code PROMO10 gives 10% off any plan.

PROMO10
Copy
View plans