Skip to main content

Offset (Meta Condition Type)

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

Type ID: apoli:offset

Fields

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

Examples

Is the block above this one air? That is the usual check for room to grow (the minecraft:air block tag covers cave air and void air too):

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

Grass with air above it, combined:

{
  "type": "apoli:all_of",
  "conditions": [
    { "type": "apoli:block", "block": "minecraft:grass_block" },
    {
      "type": "apoli:offset",
      "y": 1,
      "condition": { "type": "apoli:in_tag", "tag": "minecraft: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" }
  }
}