MiniBench

MiniBench / Learn / Commands

Command Bedrock Edition ~2 min read

The /setblock command

Place one block at one spot — doors, torches, redstone, and finishing touches.

What it does

/setblock places a single block at an exact position. Where /fill is for regions, /setblock is for the details: a door in a wall, a torch for light, a lever, or a chest at a known spot.

Syntax

setblock <x y z> <block> [replaceMode]
x y z
The position for the block — exact numbers or relative ~ coordinates.
block
The block to place, e.g. torch, oak_door, glass, redstone_block.
replaceMode
replace (default) · keep (only if the spot is air) · destroy (break the old block and drop it).

Examples

setblock ~ ~1 ~ torch

A torch one block above where the command runs.

setblock ~ ~ ~3 glass

A glass block three blocks in front of you (a window).

setblock 100 65 200 chest keep

Place a chest at exact coordinates, but only if that spot is empty.

See it in action

Before and after running /setblock — in MiniBench's 3D preview and in Minecraft.

Command run

setblock ~ ~ ~6 glowstone
In Minecraft
A single glowstone block placed with /setblock in Minecraft (before)

Before

A single glowstone block placed with /setblock in Minecraft (after)

After

Not affiliated with Mojang or Microsoft. Minecraft is a trademark of Mojang Synergies AB.

Tips & techniques

Watch out for

Used in these tutorials

See /setblock in action inside a full project walkthrough:

Write it in MiniBench with autocomplete and live validation, then run it in Minecraft.