Skip to main content

XP (Entity Condition Type)

Compares the player's experience with a number. The aliases pick the unit for you: apoli:xp_levels compares levels, and apoli:xp_points compares raw points.

Type ID: apoli:xp (aliases apoli:xp_levels and apoli:xp_points)

Fields

FieldTypeDefaultDescription
comparisonComparisonrequired<, <=, >, >=, == or !=.
compare_toIntegerrequiredThe value to compare against.
unitUnitlevelslevels or points. The aliases fill this in.

Examples

Level 30 or higher:

{
  "type": "apoli:xp_levels",
  "comparison": ">=",
  "compare_to": 30
}

Gate an expensive ability behind experience that it then spends:

{
  "type": "apoli:action_on_key_press",
  "key": { "key": "key.origins.primary_active" },
  "cooldown": 100,
  "condition": {
    "type": "apoli:xp_levels",
    "comparison": ">=",
    "compare_to": 5
  },
  "entity_action": {
    "type": "apoli:and",
    "actions": [
      { "type": "apoli:add_xp", "levels": -5 },
      { "type": "apoli:apply_effect", "effect": { "effect": "minecraft:strength", "duration": 400 } }
    ]
  }
}
note

levels is the number on the XP bar, and points is the raw total, which grows faster than the level does. Only compare against points when you mean the raw amount.