Skip to content

Block Conditions

Block conditions can be used together with a conditional block replacement to check properties and types of blocks.

Conditions

All conditions follow the same schema which can be found below.

A block condition object
  • type: One of the block condition types defined below
  • Additional fields depending on the value of type, see the respective block condition type documentation for more details.

Supported Types

Always (always)

Always passes.

Root always object
  • type: always

Never (never)

Never passes.

Root never object
  • type: never

And (and)

Only passes if all the sub conditions pass.

Root and object
  • type: and
  • conditions: A list of block conditions

Or (or)

Passes if any one of the sub conditions pass.

Root or object
  • type: or
  • conditions: A list of block conditions

Not (not)

Inverts the result of the sub condition.

Root not object
  • type: not
  • condition: A block condition

Id (id)

Checks if the block matches a specific block id or tag.

Root id object
  • type: id
  • block: A block predicate, must be one of the following.
    • An id like minecraft:dirt
    • A list of ids like ["minecraft:dirt", "minecraft:stone"]
    • A tag like #minecraft:dirt

Properties (properties)

Checks if the block has a certain property value.

Root properties object
  • type: properties
  • properties: The properties to match
    • <key>: The property to check, names can be found in the f3 menu.
      • The value to match, must ALWAYS be formatted as string.

Relative (relative)

Changes the block context for the sub condition.

Root relative object
  • type: relative
  •  offset: The block to check relative to the current position.
    • An array of three ints
    • A string of coordinates parts formatted as x:y:z
    • An object with the coordinate values
      •  x: The x part of the coordinate
      •  y: The y part of the coordinate
      •  z: The z part of the coordinate
  • condition: The condition to check with the offset applied.