/setblock Command
Places a single block at the specified coordinates, replacing whatever is currently there. The optional mode controls how the existing block is handled: destroy drops the old block and its items; keep only places the block if the target is air; replace (default) silently removes the old block; strict places the block without triggering block-updates or shape-updates (added in Java 1.21.5).
Syntax
/setblock <pos> <block> [destroy|keep|replace|strict]Permission: 2Edition: Both
Examples
/setblock 100 64 -200 minecraft:stone/setblock ~ ~1 ~ minecraft:chest[facing=north]{Items:[]} replace/setblock ~5 ~ ~5 minecraft:oak_log[axis=y] destroy/setblock 0 63 0 minecraft:redstone_block strictNotes
The strict mode (suppresses block updates) is Java Edition only and was added in Java 1.21.5 (snapshot 25w02a). Bedrock uses destroy/replace/keep but not strict.