Skip to main content

Prevent Entity Selection (Power Type)

Stops the player from targeting entities with their crosshair. Attacks and interactions pass straight through the entity to whatever is behind it, the same way apoli:prevent_block_selection works for blocks.

Type ID: apoli:prevent_entity_selection

It also answers to apugli:prevent_entity_selection.

Fields

FieldTypeDefaultDescription
entity_conditionEntity Condition TypeoptionalIf set, only entities that pass this condition become unselectable.
bientity_conditionBi-entity Condition TypeoptionalIf set, an entity only becomes unselectable while this condition holds. The actor is the player with the power and the target is the entity being looked at.

With neither field, every entity becomes unselectable.

Examples

{
    "type": "apoli:prevent_entity_selection",
    "entity_condition": {
        "type": "apoli:in_tag",
        "tag": "minecraft:undead"
    }
}

The player can't hit or interact with undead mobs. The swing goes through them and lands on whatever is behind.

{
    "type": "apoli:prevent_entity_selection",
    "bientity_condition": {
        "type": "apoli:distance",
        "comparison": ">",
        "compare_to": 3
    },
    "condition": {
        "type": "apoli:sneaking"
    }
}

While sneaking, the player can only target entities within three blocks, and looks straight through anything further away.

warning

The client decides what the crosshair is allowed to pick, so the power's conditions are evaluated on the client of the player who has the power. Conditions that depend on state the client doesn't have won't answer correctly here.