Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/setblock

From SAS Gaming Wiki

Template:Infobox command Changes a Minecraft:block to another block.

Syntax

  • Java Edition
setblock <pos> <block> [destroy|keep|replace|strict]
  • Bedrock Edition
setblock <position: x y z> <tileName: Block> <blockStates: block states> [destroy|keep|replace]
setblock <position: x y z> <tileName: Block> [destroy|keep|replace]

Arguments

Template:Argument

Specifies the position of the block to be changed.
Template:Arg desc

Template:Argument

Specifies the new block.
Template:Arg desc

Template:El: Template:Argument

Specifies the Minecraft:block states to use for the block.
Template:Arg desc

Template:Code and Template:Code

Specifies how to handle the block change. Must be one of:
  • destroy — The old block Minecraft:drops both itself and its contents (as if destroyed by a Minecraft:player). Plays the appropriate block breaking noise.
  • keep — Only Minecraft:air blocks are changed (non-air blocks are unchanged).
  • replace — The old block drops neither itself nor any contents. Plays no sound.
  • strict — Place blocks as-is without triggering block updates and shape updates.
If not specified, defaults to replace.

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Output

Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table

Examples

  • Put a chest facing east at your feet
  • Place a sign next to it Template:In
    • setblock ~ ~ ~-1 birch_sign{Text1:'"My chest"',Text2:'"Do not open!"'} (Note the two sets of quotes around the text. They are required.)
  • Put a top quartz slab at the top of your head

History

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

See also

References

<references/>

External links

Navigation

Template:Navbox commands

Minecraft:de:Befehl/setblock Minecraft:ja:コマンド/setblock Minecraft:pt:Comandos/setblock Minecraft:ru:Команды консоли/setblock Minecraft:uk:Команди консолі/setblock Minecraft:zh:命令/setblock