add Xp
Adds experience points to the player's total XP.
This method provides a safe way to modify player XP with automatic dirty tracking. Only modifies the XP and dirty flag if the amount is non-zero, avoiding unnecessary database operations.
Usage Examples:
playerData.addXp(100L) // Adds 100 XP
playerData.addXp(-50L) // Removes 50 XP
playerData.addXp(0L) // No change, no dirty flag setContent copied to clipboard
Side Effects:
Updates the
xppropertySets
isDirtyto true if amount is non-zeroMay trigger level-up calculations in other systems
Parameters
amount
The amount of XP to add (can be negative to subtract)