Skip to main content

Block Conditions

Conditions that test a block at a position.

Adjacent

Counts the neighbouring blocks that pass a condition and compares the count with a number.

Attachable

Checks whether a block that needs support could attach at this position.

Blast Resistance

Compares the block's blast resistance with a number.

Block

Checks whether the block is a given block, or in a block tag.

Block Entity

Checks whether the block has a block entity.

Block State

Checks a block state property of the block, such as facing or age.

Command

Runs a command at the block's position and compares its result with a number.

Distance From Coordinates

Compares the block's distance from a point, such as the world origin or spawn, with a number.

Exposed To Sky

Checks whether the sky is visible from the block's position.

Fluid

Checks the fluid at the block's position with a fluid condition.

Hardness

Compares the block's hardness, which decides how long it takes to break, with a number.

Height

Compares the block's Y position with a number.

In Tag

Checks whether the block is in a block tag.

Light Blocking

Checks whether the block is marked in code as blocking light.

Light Level

Compares the light level at the block's position with a number.

Movement Blocking

Checks whether the block is marked as blocking movement and has a collision shape.

NBT

Checks whether the block entity's NBT contains the given data.

Offset

Checks a block condition at a position offset from the current one.

Replacable

Checks whether the block can be replaced by placing another block, like tall grass or water.

Script

Passes when a script returns true for the block position.

Slipperiness

Compares the block's slipperiness with a number.

Tick Rate

Checks the tick rate of the chunk the block is in, or of its dimension, and whether time is frozen there.

Water Loggable

Checks whether the block can be waterlogged, so a fluid can share its space, as with stairs.