Skip to main content

Prevent Entity Use (Power Type)

Stops the player that has the power from using (right-clicking) entities. When it stops them, it can run a bi-entity action, run item actions and give them an item. The actor is the entity with the power, and the target is the entity that was right-clicked.

Type ID: apoli:prevent_entity_use

Fields

FieldTypeDefaultDescription
bientity_actionBi-entity Action TypeoptionalIf set, this action runs on the actor, the target or both.
held_item_actionItem Action TypeoptionalIf set, this action runs on the item the actor right-clicked the target with.
result_item_actionItem Action TypeoptionalIf set, this action runs on the item given to the actor.
bientity_conditionBi-entity Condition TypeoptionalIf set, the actions only run when the actor and target pass this condition.
item_conditionItem Condition TypeoptionalIf set, the actions only run when the item the actor right-clicked with passes this condition.
handsArray of Strings["off_hand", "main_hand"]The hands the actor can use for the power to trigger: "off_hand", "main_hand" or both.
result_stackItem StackoptionalIf set, this item stack is given to the actor.

Examples

{
    "type": "apoli:prevent_entity_use",
    "bientity_action": {
        "type": "apoli:actor_action",
        "action": {
            "type": "apoli:execute_command",
            "command": "title @s actionbar {\"text\": \"Cannot interact with pigs!\", \"color\": \"red\"}"
        }
    },
    "bientity_condition": {
        "type": "apoli:target_condition",
        "condition": {
            "type": "apoli:entity_type",
            "entity_type": "minecraft:pig"
        }
    }
}

This stops the player from interacting with pigs, including through powers that would let them, and runs an apoli:execute_command that tells them so in the action bar.