Minecraft:Commands/setblock
From SAS Gaming Wiki
More actions
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
- Specifies the position of the block to be changed.
- Template:Arg desc
- 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
setblock ~ ~ ~ chest[facing=east]Template:Onlysetblock ~ ~ ~ chest ["minecraft:cardinal_direction"="east"]Template:Only
- 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
setblock ~ ~2 ~ quartz_slab[type=top]Template:Onlysetblock ~ ~2 ~ quartz_slab ["minecraft:vertical_half"="top"]Template:Only
History
Java Edition
Bedrock Edition
See also
- Template:Cmd — modifies the data tags of a block or entity
- Template:Cmd — copies blocks from one region to another
- Template:Cmd — fills a region with a block
References
<references/>
External links
Minecraft:de:Befehl/setblock Minecraft:ja:コマンド/setblock Minecraft:pt:Comandos/setblock Minecraft:ru:Команды консоли/setblock Minecraft:uk:Команди консолі/setblock Minecraft:zh:命令/setblock