Skip to main content

Damage Over Time (Power Type)

Damages the entity with the power on an interval. apoli:damage_over_time is a legacy alias: it resolves to apoli:action_over_time with an apoli:damage action built for you, so existing data packs keep working unchanged.

Type ID: apoli:damage_over_time

Fields

FieldTypeDefaultDescription
damageFloatrequiredHow much damage to deal each interval.
damage_easyFloatvalue of damageThe damage dealt on Easy difficulty.
damage_typeIdentifierminecraft:genericThe damage type to use.
intervalInteger20Ticks between hits.
onset_delayIntegervalue of intervalTicks to wait after the condition becomes true before the first hit.

The same power without the alias

In new packs, write the power out like this. It is what the alias expands to, and it lets you swap the damage for any other entity action:

{
  "type": "apoli:action_over_time",
  "interval": 20,
  "onset_delay": 20,
  "entity_action": {
    "type": "apoli:damage",
    "amount": 1,
    "damage_type": "minecraft:starve"
  },
  "condition": { "type": "apoli:food_level", "comparison": "<=", "compare_to": 6 }
}

When damage_easy differs from damage, the alias wraps the action in an apoli:if_else on the apoli:difficulty condition. You can write that yourself for finer control, such as a separate value for Hard.

note

protection_enchantment and protection_effectiveness are not supported. They don't scale the onset delay, and Apoli logs a warning once if a pack sets them. Track the protection level in an apoli:resource and use an expression instead, such as "onset_delay": "20 + mypack:protection * 26", which also works for things other than enchantments.