Action When Hit

Power Type

Executes a Bi-entity Action Type if the entity that has the power has been hit by another entity.

Type ID: origins:action_when_hit

Fields

Field Type Default Description
bientity_action Bi-entity Action Type The action to be executed on either or both 'actor' (the attacker entity) entity and 'target' (the entity that has the power) entity.
damage_condition Damage Condition Type optional If specified, the specified action will only trigger when this condition holds for the specified type of damage.
cooldown Integer 1 Interval of ticks this power needs to recharge before the power can be triggered again.
hud_render Hud Render {"should_render": false} Determines how the cooldown of this power is visualized on the HUD.
bientity_condition Bi-entity Condition Type optional If specified, the specified action will only trigger if this condition is fulfilled by either or both 'actor' (the attacker entity) entity and 'target' (the entity that has the power) entity.

Examples

{
    "type": "origins:action_when_hit",
    "bientity_action": {
        "type": "origins:actor_action",
        "action": {
            "type": "origins:damage",
            "amount": 2,
            "source": {
                "name": "thorns"
            }
        }
    }
}

This example will deal 1 heart of damage to any entities that attacks the entity that has the power, quite similar to having an armor item that has the Thorns enchantment