Hi. It been while since xp procedures was implemented. Ok, there is "Add Xp to to the provided player", "Add Xp levels to to the provided player", and only "Get player XP level".
Well, it's possible to substract xp points by adding negative values, but its some problem with it. Since it's possible to force levelup by adding xp points, there force leveldown by substact xp points isn't possible.
There is problem, because isn't possible ACCURATELY manage xp points. So there isn't a good xp storage way.
So there is possible for you to implement a procedure like "Get player XP"? But for xp points, not levels...
If return of number of total all player's xp points isn't possible, then at least return of xp points that player has at current level can be fine too.
Issue comments
Hmm... I wonder, how others mods(like OpenBlocks, XP Tome) can accurately manage xp points.
You know, there on MC Wiki is table of XP leveling and denotes amount of xp needed to specified level, so this is possible to make some experience point storage system in MCreator, but this way will always does comes with lesser or greater lose of some xp points. Precisely, amount of xp point that isn't enought to leveling at next level will be wasted.
https://github.com/bl4ckscor3/XP-Tome/blob/1.15/src/main/java/openmods/utils/EnchantmentUtils.java
Hey, maybe this will helpful for this. Have you seen it before?
Here, there another example - something bit similar to previous. If this would somehow help you, then will be great. :)
https://github.com/Lothrazar/Cyclic/blob/trunk/1.12/src/main/java/com/l…
Thank you, I will consider adding this :)
Although if you are in hurry, you can check the code you linked, it is possible to implements the maths to convert XP levels to points in procedures, but this might not always be accurate, not just with procedures but even if the code linked would be hardcoded, at least I got that feeling checking the code.
There is no public method to access points directly, this was covered before so we can not really implement this at this point.