Skip to main content

Action On Kill (Power Type)

Runs an action when the entity with the power kills another entity. The actor is the entity with the power (the killer), and the target is the entity that died.

Type ID: apoli:action_on_kill

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 runs. It never turns other fields off.

FieldTypeDefaultDescription
bientity_actionBi-entity Action TypeoptionalRuns on the killer and victim as a pair.
self_actionEntity Action TypeoptionalRuns on the killer, the entity that has the power.
attacker_actionEntity Action TypeoptionalRuns on the killer. Here the killer is the entity with the power, so this does the same as self_action.
target_actionEntity Action TypeoptionalRuns on the entity that died.
entity_actionEntity Action TypeoptionalLegacy field. Runs on whichever side entity_action_target names.
entity_action_target"self", "attacker" or "target""self"Which entity entity_action runs on. The legacy ID below sets it for you.
bientity_conditionBi-entity Condition TypeoptionalMust pass for the killer and victim pair before the power fires.
target_conditionEntity Condition TypeoptionalMust pass for the entity that died.
attacker_conditionEntity Condition TypeoptionalMust pass for the killer.
damage_conditionDamage Condition TypeoptionalMust pass for the killing damage.
cooldownInteger or Expression1Ticks the power needs to recharge between fires.
hud_renderHUD Render{"should_render": false}How the cooldown is shown on the HUD.

Apace compatibility

Legacy IDentity_action runs on
apoli:action_on_killthe killer
apoli:self_action_on_killthe killer

apoli:self_action_on_kill is only an alias. It doesn't rename or consume fields, so a power written under it can use bientity_action, self_action and target_action alongside its entity_action.

Examples

{
  "type": "apoli:action_on_kill",
  "self_action": {
    "type": "apoli:heal",
    "amount": 2
  },
  "target_condition": {
    "type": "apoli:in_tag",
    "tag": "minecraft:skeletons"
  }
}

This heals the killer one heart whenever they kill a skeleton.

{
  "type": "apoli:self_action_on_kill",
  "entity_action": {
    "type": "apoli:add_xp",
    "points": 5
  },
  "target_action": {
    "type": "apoli:spawn_particles",
    "particle": "minecraft:soul"
  }
}

The legacy ID still runs entity_action on the killer, and target_action works alongside it.