/setblock

Cheats / op 2Java 26.3

Places a single block. Its basic form is /setblock <pos> <block>; it has 5 syntax forms and 2 arguments. Permission: Cheats / op 2.

Who can use it
Cheats / op 2
Syntax forms
5
Arguments
2

/setblock syntax

Game data

Every form the game accepts. Words in <angle brackets> are arguments you fill in; everything else is typed as is.

/setblock <pos> <block>
/setblock <pos> <block> destroy
/setblock <pos> <block> keep
/setblock <pos> <block> replace
/setblock <pos> <block> strict

/setblock examples

Ready-to-paste examples (cheats on). @s is you, @p the nearest player, @a everyone, @e every entity.

/setblock ~ ~ ~ minecraft:chest
Places a chest where you stand.
/setblock ~ ~-1 ~ minecraft:diamond_block replace
Turns the block under you into a diamond block.

/setblock arguments

What each argument expects, with the limits the game enforces.

/setblock arguments
ArgumentExpectsLimits
<pos>Block coordinates (x y z, ~ relative, ^ local)—
<block>Block ID with optional [states]—

Related commands

Data: Minecraft Java Edition 26.3 game files. How we source this

Places a single block. It has 5 syntax forms and can be run by: Cheats / op 2.

See Also

🔍

Help us maintain accuracy! If you notice incorrect stats, missing data, or any issues, your feedback directly improves the quality of our data for the entire community.

Report an Issue

/setblock FAQ (Java 26.3)

What does /setblock do in Minecraft?

Places a single block.

What is the syntax of /setblock?

The basic form is /setblock <pos> <block>. All forms are listed above.

What is an example of /setblock?

/setblock ~ ~ ~ minecraft:chest — Places a chest where you stand.

Do you need cheats for /setblock?

Yes: Cheats / op 2. In singleplayer turn on Allow Cheats (or open to LAN with cheats).