Skip to content
MC Command Generator

/setblock Command Generator

Beta

Pick a block, set its states from a list (Java) or type them (Bedrock), choose how it replaces what is there, and copy a /setblock command for your version.

Describe it — AI writes the command

Type what you want in plain words. The AI fills the form below, so you can see it and change anything. It follows the edition and version you picked.

Checking the AI…

Paste a command— edit it here or move it to another version
Block statesJava

Loading block states…

Block dataJava only
facing=easthalf=top
Oak Stairs at ~ ~ ~

Your command · Java 26.3

58 characters
/setblock ~ ~ ~ minecraft:oak_stairs[facing=east,half=top]

Raw editor

Click or tap any key or value to see its full path here.
Valid NBT In sync
Ctrl+F find · Ctrl+Space suggest · Ctrl+. fix · Shift+Alt+F format

How it works

/setblock puts a single block at a position. The hard part is block states: the direction a stair faces, whether a slab sits at the top, which way a log lies. Java and Bedrock write them differently and even give them different names.

Java 1.13 and later

States go in square brackets right after the block ID, and block entity data (chests, signs, spawners) in curly braces after that:

setblock ~ ~ ~ minecraft:oak_stairs[facing=east,half=top] destroy
setblock 100 64 -20 minecraft:chest{Lock:"secret"} keep

The state lists here come from the newest Java release, and only the states you change are written, so the rest stay at their defaults. Java 1.21.5 added a fourth mode, strict, which places the block without updating its neighbours (no falling sand, no fences reconnecting).

Bedrock

Bedrock takes the states as a separate argument with quoted names. Stairs use weirdo_direction (0 east, 1 west, 2 south, 3 north) instead of facing:

setblock ~ ~ ~ oak_stairs ["weirdo_direction"=0,"upside_down_bit"=true] destroy

Before Bedrock 1.20.10 the separator was a colon (["weirdo_direction":0]); the generator writes the colon when you pick 1.18 or 1.19. Bedrock has no block NBT, so chest locks and similar data are Java only.

Modes

replace (the default) swaps the block silently. destroy breaks the old block first, with sound and drops. keep only places the block if the spot is air.

Java 1.12 and older

Before the 1.13 flattening, blocks used numeric data values (setblock ~ ~ ~ stone 1 for granite). The generator does not write that format.

FAQ

How do I make stairs face a certain way with /setblock?

On Java add [facing=north] (or east, south, west) after the ID. On Bedrock use ["weirdo_direction"=3] for north; 0 is east, 1 west, 2 south. Pick the stairs in the generator and choose from the list.

Why does my Bedrock /setblock say the block states are wrong?

Bedrock state names are not the same as Java's, and versions before 1.20.10 used a colon instead of an equals sign. Type the Bedrock names (for example "minecraft:cardinal_direction") and pick your version so the right separator is used.

What is the difference between destroy, keep and replace?

replace overwrites the block with no drops. destroy breaks it like a player would, dropping it as an item. keep does nothing unless the target spot is air.

Can /setblock place a chest with items?

On Java, yes: put the block entity data in curly braces after the block, such as {Items:[{Slot:0b,id:"minecraft:diamond",count:1}]} (Count:1b before 1.20.5). Bedrock's /setblock has no NBT, so use /loot or /replaceitem after placing the chest.

What does strict mode do?

Added in Java 1.21.5, strict places the block exactly as written and does not update the blocks around it, so sand will not fall and fences will not connect. Older versions and Bedrock do not have it.