/testforblock

Tests whether a certain block is in a specific location.

Operator (cheats on)Cheats must be onChecked on 1.26.66.1

Syntax

Exactly as the game prints it. <angle brackets> are required, [square brackets] are optional.

/testforblock <position: x y z> <tileName: Block> [blockStates: block states]
/testforblock <position: x y z> <tileName: Block> [dataValue: int]

More from 9Minecraft

Command reference © 2026 9Minecraft.net. Syntax read from Minecraft Bedrock Edition 1.26.66.1.