Skip to content

Self Action When Hit

apace100 edited this page Nov 2, 2020 · 3 revisions

Power Type. Executes an entity action on the player when the player is hit by another entity.

Type ID: origins:self_action_when_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 attacker.

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.

Example:

{
  "type": "origins:self_action_when_hit",
  "entity_action": {
    "type": "origins:apply_effect",
    "effect": {
      "effect": "minecraft:regeneration",
      "amplifier": 1,
      "duration": 200
    } 
  },
  "damage_condition": {
    "type": "origins:amount",
    "comparison": ">=",
    "compare_to": 6.0
  },
  "cooldown": 1200
}

When a player with this power is damaged by 3 hearts or more damage in a single hit, they gain a Regeneration II effect for 10 seconds. This has a cooldown of one minute.

Clone this wiki locally