Skip to content

Xp Change

LLytho edited this page Oct 21, 2022 · 3 revisions

Xp Change

This event can be cancelled!

// for 1.18 pls use: onEvent("morejs.player.xp_change", (event) => { ... })
MoreJSEvents.playerXpChange((event) => {
    // `event.player`: Player that changed xp
    // `event.amount`: Amount of xp that changed
    // `event.experienceProgress`: Progress of the xp bar (0 <= progress < 1)
    // `event.experienceLevel`: Level of the player
    // `event.totalExperience`: Total experience of the player
    // `event.willLevelUp`: True if the player will level up
    // `event.xpNeededForNextLevel`: Amount of xp needed to reach the next level
    // `event.remainingExperience`: Amount of xp that is left to reach the next level
});
Clone this wiki locally