Block Collision (Entity Condition Type)

Checks whether the bounding box of the entity collides with a block.

Checks whether the bounding box of the entity collides with a block.

Type ID: apoli:block_collision

Fields

FieldTypeDefaultDescription
block_conditionBlock Condition TypeoptionalIf specified, the condition type will only evaluate to true if the bounding box of the entity is colliding with a block that fulfills this condition.
offset_xFloat0By how much of the bounding box size should the box be offset in the X direction (e.g.: 0 = no offset, 1 = offset of exact width, 2 = offset of twice the width of the bounding box)
offset_yFloat0By how much of the bounding box size should the box be offset in the Y direction (e.g.: 0 = no offset, 1 = offset of exact height, 2 = offset of twice the height of the bounding box)
offset_zFloat0By how much of the bounding box size should the box be offset in the Z direction (e.g.: 0 = no offset, 1 = offset of exact depth, 2 = offset of twice the depth of the bounding box)

Examples

"condition": {
    "type": "apoli:block_collision",
    "offset_x": 0.1,
    "offset_y": 0,
    "offset_z": 0.1
}

This example will check if the entity is colliding with the positive X or Z faces of a block.

"condition": {
    "type": "apoli:or",
    "conditions": [
        {
            "type": "apoli:block_collision",
            "block_condition": {
                "type": "apoli:block",
                "block": "minecraft:slime_block"
            },
            "offset_x": 0.1,
            "offset_z": 0.1
        },
        {
            "type": "apoli:block_collision",
            "block_condition": {
                "type": "apoli:block",
                "block": "minecraft:slime_block"
            },
            "offset_x": -0.1,
            "offset_z": -0.1
        }
    ]
}

This example will check if the entity is colliding with the X and Z faces of a Slime block.