Self Action On Hit - apace100/origins-fabric GitHub Wiki

Power Type. Executes an entity action on the player when the player hits another entity.

Type ID: origins:self_action_on_hit

Fields:

entity_action, Entity Action: The action to execute on the player.

damage_condition, Damage Condition, optional: If set, the action will only trigger when this condition holds for the damage that was dealt by the player.

cooldown, int: Interval of ticks this power needs to recharge before the action can be executed again.

hud_render, Hud Render, optional: If set, the cooldown of this power is visualized on the HUD in the specified way.

target_condition, Entity Condition, optional: If set, the action will only be triggered when a target matching this condition is hit.

Example:

{
  "type": "origins:self_action_on_hit",
  "entity_action": {
    "type": "origins:heal",
    "amount": 8.0
  },
  "damage_condition": {
    "type": "origins:amount",
    "comparison": ">=",
    "compare_to": 10.0
  },
  "cooldown": 20
}

When a player with this power manages to deal 5 hearts or more damage in a single hit, they will heal for 4 hearts.