Skip to content
/SLASHPLAY

How to place a block with a command in Minecraft

Type /setblock ~ ~1 ~ minecraft:chest in chat as an operator to place a chest one block above you. Add destroy or keep to change how it replaces.

setblock

Places a single block at a position, with options to keep, destroy or replace what is already there.

/setblock <pos> <block> [destroy|keep|replace|strict]

Examples

/setblock ~ ~1 ~ minecraft:chest

Places a chest one block above you.

/setblock 10 64 -20 minecraft:oak_stairs[facing=north]

Places stairs facing north.

/setblock ~ ~-1 ~ minecraft:air destroy

Breaks the block under you and drops it.

Arguments

posRequired
Block coordinates, absolute or relative.
blockRequired
Block ID with optional [states] and {data}.
modeOptional
replace (default), destroy, keep or strict.

What it does

The default replace mode overwrites the block silently, destroy breaks the old block and drops it as an item, keep only places into air, and strict places the block without updating neighbors. Add block states in square brackets and block entity data in curly braces, for example a chest's contents.

Good to know

  • Needs operator permission level 2.
  • The position must be in a loaded chunk.

Run it on your server

On a SLASHPLAY server, type it in the Console tab without the leading slash; in game, operators type it in chat with the slash. New to this? Start a Minecraft server first.

Your own
Minecraft server.

From $0.03 an hour, only while it runs. New accounts get 6 free tokens.