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 position of the block to be changed.


 * Specifies the new block.
 * Specifies the new block.


 * It must be between 0 and 65535 (inclusive).
 * Specifies the block data to use for the new block. Values that are invalid for the specified block id revert to 0. If not specified, defaults to 0.
 * Specifies the block data to use for the new block. Values that are invalid for the specified block id revert to 0. If not specified, defaults to 0.

lit. 'destroy' or 'keep' or 'replace'
 * 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.)
 * Place a sign next to it ⇭⇭⇭⇭⇭
 * (Note the two sets of quotes around the text. They are required.)

History
Befehl/setblock Команды консоли/setblock Команди консолі/setblock 命令/setblock