Skip to main content

Distance From Coordinates (Block Condition Type)

Compares the distance between the block and a point, such as the world origin or the world spawn, with a number.

Type ID: apoli:distance_from_coordinates

Fields

FieldTypeDefaultDescription
referenceString"world_origin"The point to measure from: "world_origin" or "world_spawn".
offsetVectoroptionalMoves the reference point by this much.
ignore_xBooleanfalseWhether to treat the X axis as 0.
ignore_yBooleanfalseWhether to treat the Y axis as 0.
ignore_zBooleanfalseWhether to treat the Z axis as 0.
shapeString"cube"How the distance is measured. "cube" takes the largest axis, "star" adds the axes up, and "sphere" is the straight-line distance. A hollow shape name measures like its solid form, and any other name measures like "sphere".
scale_reference_to_dimensionBooleantrueWhether the reference point takes the dimension's coordinate scale into account.
result_on_the_wrong_dimensionBooleanoptionalWhen set, this is the result whenever the block isn't in the reference point's dimension.
round_to_digitIntegeroptionalRounds the distance to this many digits after the decimal point. Negative numbers work too, so -2 rounds to multiples of 100.
comparisonComparisonrequiredHow the distance, in blocks, is compared with compare_to.
compare_toFloatrequiredThe number the distance is compared with.

Examples

"block_condition": {
    "type": "apoli:distance_from_coordinates",
    "offset": {
        "x": 1024,
        "z": 512
    },
    "ignore_y": true,
    "comparison": "<",
    "compare_to": 8
}

This checks whether the block is within 8 blocks of X 1024, Z 512, ignoring height.