EXPChange
com.jsmacrosce.jsmacros.client.api.event.impl.player.EventEXPChange
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 valuetotal: incoming total experience valuelevel: incoming experience level valueprevProgress: supplied prior experience progress valueprevTotal: supplied prior total experience valueprevLevel: supplied prior experience level value
Fields
level
Experience level value being applied.
prevLevel
The prior experience level value.
prevProgress
The prior experience progress value.
prevTotal
The prior total experience value.
progress
Experience progress value being applied.
total
Total experience value being applied.