Action On Hit (Power Type)

Executes an action when the entity that has the power has hit another entity, after the hit's damage actually lands.

Executes an action when the entity that has the power has hit another entity, after the hit’s damage actually lands.

Type ID: apoli:action_on_hit

In the context of this power type, the actor is the entity that has the power and the target is the entity that was hit.

Fields

Every field below works under every ID this power type answers to. The legacy ID you write only decides where a legacy entity_action lands — it never turns other fields off.

FieldTypeDefaultDescription
bientity_actionBi-entity Action TypeoptionalAction run with the actor/target pair when the hit lands.
self_actionEntity Action TypeoptionalAction run on the actor (the entity that has the power).
attacker_actionEntity Action TypeoptionalAction run on the attacker. Here the attacker is the holder, so this is a synonym for self_action.
target_actionEntity Action TypeoptionalAction run on the target (the entity that was hit).
entity_actionEntity Action TypeoptionalLegacy field. Runs on whichever side entity_action_target names.
entity_action_target"self" / "attacker" / "target""self"Which entity entity_action runs on. Set automatically by the legacy IDs below.
bientity_conditionBi-entity Condition TypeoptionalGates firing on the (actor, target) pair.
target_conditionEntity Condition TypeoptionalGates firing on the target.
attacker_conditionEntity Condition TypeoptionalGates firing on the attacker (the holder).
damage_conditionDamage Condition TypeoptionalGates firing on the damage that was dealt.
cooldownInteger1Ticks the power needs to recharge between fires.
hud_renderHud Render{"should_render": false}How the cooldown is shown on the HUD.

All action and condition fields are optional. Specifying several actions runs all of them, in the order listed above.

Inside any of these actions the damage Expression variable holds the damage amount of the hit.

Apace compatibility

This power type absorbs three legacy Apace types into one schema, and JSON authored under the old IDs still loads unchanged.

Legacy IDentity_action runs onNotes
apoli:action_on_hitthe actor (holder)Apace’s canonical type used bientity_action; entity_action is an Apoli extension here.
apoli:self_action_on_hitthe actor (holder)Apace’s variant that ran the action on the actor.
apoli:target_action_on_hitthe targetApace’s variant that ran the action on the target.

The legacy IDs are aliases only. They no longer rename or consume fields, so a power written as apoli:target_action_on_hit can still use bientity_action, self_action and target_action alongside its entity_action, and the canonical apoli:action_on_hit accepts entity_action too. If you want entity_action on a side the alias does not imply, set entity_action_target explicitly.

Examples

Canonical form — knockback on hit

{
    "type": "apoli:action_on_hit",
    "bientity_action": {
        "type": "apoli:add_velocity",
        "z": 2
    }
}

Legacy self_action_on_hit — heal the attacker

{
    "type": "apoli:self_action_on_hit",
    "entity_action": {
        "type": "apoli:heal",
        "amount": 2
    }
}

Loads as apoli:action_on_hit with entity_action bound to the actor.

Legacy target_action_on_hit — set the target on fire

{
    "type": "apoli:target_action_on_hit",
    "entity_action": {
        "type": "apoli:set_on_fire",
        "duration": 4
    },
    "target_condition": {
        "type": "apoli:living"
    }
}

Loads as apoli:action_on_hit with entity_action bound to the target, and target_condition carried through unchanged.