/setblock Command

Changes a block to another block.

Permission Level Game Directors
Requires Cheats? Yes

Usage

Set block, tile data

/setblock <position: x y z> <tileName: Block> <blockStates: block properties> [oldBlockHandling: SetBlockMode]

Set a block in a position using tile name with optional tile data and old block handling fill methods.

Set block, block states

/setblock <position: x y z> <tileName: Block> [oldBlockHandling: SetBlockMode]

Set a block in a position using tile name with optional block states and old block handling fill methods.

Arguments

  • blockStates: block properties The block states from the enum to use for the block to be set.
  • oldBlockHandling: SetBlockMode An enum of type destroy, hollow, keep, outline, or replace. Default: replace.
  • position: x y z: position A vector [x y z] that defines the position of the block to change.
  • tileName: Block An block name from the enum that specifies the new block.

Enums

SetBlockMode

Enum of Set Block Modes

Values

  • replace Replace
  • destroy Destroy
  • keep Keep