Resource (Advancement Trigger)

Fires when a resource or cooldown the player holds changes value.

Fires every time a resource or cooldown the player holds is written to, carrying the value it landed on.

Trigger ID: apoli:resource

Fields

FieldTypeDefaultPurpose
playerEntity predicateoptionalThe usual vanilla player predicate.
resourceIdentifieroptionalThe resource power that changed. Omit it to match any of them.
valueInt rangeanyBounds the value must land inside, as vanilla’s {"min": x, "max": y} — a bare number means exactly that value.

Example

{
  "criteria": {
    "full_mana": {
      "trigger": "apoli:resource",
      "conditions": {
        "resource": "example:mana",
        "value": { "min": 100 }
      }
    }
  },
  "requirements": [["full_mana"]]
}

An advancement for spending everything you had:

{
  "criteria": {
    "ran_dry": {
      "trigger": "apoli:resource",
      "conditions": {
        "resource": "example:mana",
        "value": 0
      }
    }
  },
  "requirements": [["ran_dry"]]
}

Notes

  • It fires on a write, which is what apoli:modify_resource, /apoli:resource set and a resource power’s own recharge all do. A cooldown counting itself down tick by tick is not a write and does not fire.
  • The value reported is the one actually stored, after the resource’s min/max clamp and after any apoli:modify_resource_change.