Commands/setblock

Changes a block to another block.

Syntax

 * Java Edition


 * Bedrock Edition

Arguments

 * Specifies the position of the block to be changed.


 * Specifies the new block.


 * Specifies the block states to use for the block.
 * Specifies the block states to use for the block.

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

Examples

 * Put a chest facing east at your feet
 * Place a sign next to it $$
 * (Note the two sets of quotes around the text. They are required.)
 * Put a top quartz slab at the top of your head
 * (Note the two sets of quotes around the text. They are required.)
 * Put a top quartz slab at the top of your head