/testforblock Command

Tests whether a certain block is in a specific location.

Permission Level Game Directors
Requires Cheats? Yes

Usage

Test for block, optional data value

/testforblock <position: x y z> <tileName: Block> [blockStates: block properties]

Test for a block name in a vector position with optional data value.

Arguments

  • blockStates: block properties Optional. The block states to match when testing.
  • position: x y z: position Required. A vector of the location the block to test.
  • tileName: Block Required. An enum of the block to test for.