On Experience Lost

Description

Fires when an Experience Loss Rule is applied at the player's death — and at least one of rpgLost or vanillaLevelLost is greater than zero. Rules that result in zero loss don't fire this trigger.

Variables

Variable Type Description
rpgLost double Amount of archetype XP lost (after the rule's percent + flat + level-floor calculations).
vanillaLevelLost int Number of vanilla levels the player lost.
xp-rule string The id of the rule that was applied (e.g. Default, or your override's name).

Examples

Show the player how much they lost on death:

xp_loss_feedback:
  Skills:
  - sound{s=entity.wither.hurt;p=0.7;v=0.5} @self ~onExperienceLost
  - message{m="<red>You lost <skill.var.rpgLost> archetype XP and <skill.var.vanillaLevelLost> levels."} @self ~onExperienceLost

Run a different consolation effect on rules that wipe more than 5 vanilla levels:

- skill{s=BigLossEffect} @self ~onExperienceLost ?numericGreater{a=<skill.var.vanillaLevelLost>;b=5}

Aliases

  • onXpLost
Updated Aug 19, 2026