Skip to content

EXPChange ​

com.jsmacrosce.jsmacros.client.api.event.impl.player.EventEXPChange

Since1.2.7Not cancellable

Fires before the client writes the local player's experience values. The current fields contain the incoming values and the prev fields contain the prior values. It fires on every set,
including unchanged values.

js
JsMacros.on("EXPChange", JavaWrapper.methodToJava(function (event) {
  if (event.level !== event.prevLevel) {
    if (event.level > event.prevLevel) {
      Chat.log(`Level up, now level ${event.level} with ${event.total} total xp`);  
    } else {
      Chat.log(`Lost levels, back to level ${event.level}`);  
    }
  } else {
    Chat.log(`Progress towards level ${event.level + 1} is ${event.progress}`);  
  }
}))

Constructors ​

new EventEXPChange ​

new EventEXPChange(float progress, int total, int level, float prevProgress, int prevTotal, int prevLevel)#
Stores the supplied incoming experience values and their supplied prior values.

Parameters:

  • progress: incoming experience progress value
  • total: incoming total experience value
  • level: incoming experience level value
  • prevProgress: supplied prior experience progress value
  • prevTotal: supplied prior total experience value
  • prevLevel: supplied prior experience level value

Fields ​

level ​

level: intread-only#
Experience level value being applied.

prevLevel ​

prevLevel: intSince1.6.5read-only#
The prior experience level value.

prevProgress ​

prevProgress: floatSince1.6.5read-only#
The prior experience progress value.

prevTotal ​

prevTotal: intSince1.6.5read-only#
The prior total experience value.

progress ​

progress: floatread-only#
Experience progress value being applied.

total ​

total: intread-only#
Total experience value being applied.

Methods ​

toString ​

toString(): String#
Returns an event-name-prefixed diagnostic containing only the stored total experience value. Its exact format is %s:{"total": %d}; this is not a complete event payload or serialization.
Returns: event name and stored total experience in the diagnostic format