Offset (Meta Condition Type)

Tests a block condition at a position offset from this one.

Tests a block condition at a position offset from the one being checked. This is a block condition only — it has no entity or item equivalent, because only block conditions have a position to offset from.

Type ID: apoli:offset

Fields

FieldTypeDefaultDescription
conditionBlock ConditionrequiredThe condition to test at the offset position.
xInteger0Blocks east.
yInteger0Blocks up.
zInteger0Blocks south.

Examples

Is the block above this one air? This is the usual “is there room to grow” check:

{
  "type": "apoli:offset",
  "y": 1,
  "condition": { "type": "apoli:air" }
}

Standing on grass with air above, combined:

{
  "type": "apoli:all_of",
  "conditions": [
    { "type": "apoli:block", "block": "minecraft:grass_block" },
    {
      "type": "apoli:offset",
      "y": 1,
      "condition": { "type": "apoli:air" }
    }
  ]
}

Offsets nest, so you can reach diagonally or several blocks out:

{
  "type": "apoli:offset",
  "x": 1,
  "condition": {
    "type": "apoli:offset",
    "y": -1,
    "condition": { "type": "apoli:block", "block": "minecraft:water" }
  }
}