Experience module does not work properly with players given levels using commands
TheIllusiveC4 opened this issue ยท 1 comments
Versions (Be specific, do not write "latest"):
- Corpse Complex: 1.16.5-4.0.2.0
- Forge: 36.0.1
Observed Behavior:
When using the commands /xp add
or /xp set
for levels, the experience module will not give proper values and acts on the experience values of the player before the command was executed.
Expected Behavior:
The experience module should have their values reflect the current experience values of the players, regardless of how they achieved those experience points.
Steps to Reproduce:
- Set the
lostXp
config value to 0.3 andxpDropMode
to "PERCENT". - Load the world.
- Start with no experience at all.
- Use
/xp add 100 levels
to add 100 levels to the player. - Use
/kill
to kill the player. - Observe that the kept experience stays at 0, rather than 70% of the 100 levels given.
Current Workarounds:
Use points
instead of levels
when using commands to give player experience.
Notes:
This is caused by the fact that Minecraft does not update experienceTotal
values on players when granting experience levels through the command. Corpse Complex uses those values in order to calculate accurate percentage loss. A solution would likely involve not relying on experienceTotal
and instead recalculate values based off the current experienceLevel
.
Commenting to note that this is currently breaking my modpack. I use Rereskillable to manage progression through spending XP points and Corpse Complex to balance XP loss. Currently using settings like this:
[experience]
lostXp = 1.0
xpDropMode = "PERCENT"
droppedXpPercent = 1.0
droppedXpPerLevel = 0
maxDroppedXp = 100000
If the player spends XP on skills for Rereskillable and then dies, they drop all of their levels from BEFORE they spent their XP.
Current workaround is to just not use Corpse Complex.