OGTOOLS

Minecraft /setblock command

Replaces the block at the given coordinates with the block you want.

🧱 Blocks and structures Operator (level 2) Needs cheats enabled Java Edition 26.3

Syntax

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

Parts in square brackets are optional, parts in angle brackets are required. You do not type the brackets: Put your own value in their place.

Arguments

ArgumentWhat it does
<block> Block ID: stone, oak_planks, redstone_block and so on. Use square brackets to set block states.
replace Removes the old block without a trace (default).
destroy Breaks the old block and drops it as an item.
keep Places the block only if the spot is air; leaves it alone if it is filled.

Examples

/setblock ~ ~-1 ~ diamond_block

Puts a diamond block under your feet.

/setblock ~ ~ ~ redstone_torch

Places a redstone torch where you stand.

/setblock 10 64 10 chest[facing=north]

Places a chest facing north.

Good to know

  • One of the most used commands in command block chains.
  • For larger areas, you need the fill command.

How do I run this command?

Press T in game to open chat (or press / directly), type the command and press Enter. While typing, Tab completes the options. This command counts as a cheat: It needs cheats enabled in a singleplayer world, and operator permission on a server (operator (level 2)).

Related commands

🧱 More Blocks and structures

Another tool Minecraft crafting recipes Would rather make the item than give it with a command? See the recipe on the 3x3 grid.

Minecraft is a product of Mojang Studios. This tool is an independent helper made for players and is not affiliated with Mojang or Microsoft.