
[Bug] Players gaining XP on death rather than losing it with XP module installed.
Luke616 opened this issue ยท 11 comments
This is currently happening on my multiplayer server, with version 1.0.1.1 for MC 1.12.2. I had configured the XP module to have the players lose 25% of their XP, but otherwise keep in when they die (not drop it as orbs). However, players were reporting gaining XP when they died instead. As a result I changed the XP module config to just keep XP on death and not attempt to drop any, but this seemed to only raise the amount of XP players were gaining. Testing this bug has been inconsistent, sometimes I'll edit the config and the lose-xp-on-death will seem to work, only for the bug to return after a few hours of play. I also have been unable to replicate the bug in single player. Here are my config settings, I can provide more info if you'd like.
experience {
# Set to true to enable experience module
B:"Enable Experience Module"=true
# Set to true to keep all XP on death
B:"Keep All XP"=false
# Percent of experience lost on death
D:"Lost XP Percent"=0.5
# Maximum amount of experience that can be recovered, 0 to disable
I:"Maximum Recoverable XP"=0
# Percent of lost experience that can be recovered
D:"Recoverable XP Percent"=0.0
}
Thanks!
Luke616
I have been unable to replicate this bug on my end. This isn't particularly conclusive since you said the bug is inconsistent, so perhaps I just have not been able to encounter it.
I'd like to know if the config files for the server and the involved clients are all the same? This is something I have to fix in the near future, but there is no auto-sync coded so having different config files between the server and the client will cause some weird issues to arise.
How the experience module is coded is that the experience is all calculated and set upon death, and then this value is copied over to the player once they respawn. Are the experience values correct after death but before respawning? If you could provide some precise numbers for the experience values before and after respawning when this bug occurs, that would be helpful to see where and how the calculations get thrown off.
I've just pushed out a new update, version 1.0.1.2, that fixes a couple other issues, but I also attempted to fix this issue. It was mostly just guesswork, so I can't be sure it did anything. Please try out this version and let me know if the problem persists.
Can confirm that the files are the same on the server and client. Experience values update after death but before clicking "respawn". Sometimes it will happen the first time I kill myself and every death after that works fine, but sometimes it happens with each death. In the case of me testing it right now, it only occurred once and then started removing XP like normal. I'll try to gather more information and let you know, thanks for looking into it!
Can you confirm that this still only occurs on servers and not single player? Usually this is a result of a desync between the server and client, in which case I might have some idea as to what is causing this.
Can confirm that the XP bug is still occurring. It seems like it'll happen randomly, but then after that one first death the XP drops regularly.
Here is a modlist of the environment in which this is occurring. Do you think some other mod may be contributing to cause the bug?
https://pastebin.com/W1G8Nikv
Can I confirm that you're saying this bug now only occurs on the first death? This will help in my investigation as this suggests something miscalculating on the very first iteration of the code.
It's certainly possible that there could be a mod conflict if one of those mods also affects XP drops, but I can't be sure at this juncture.
Luke616, can you tell me if the experience values are correct after death but before respawn? I'd like to know if the problem happens before or after clicking "respawn" (or both).
@Luke616 Checking in again to ask if this problems still happens? And if so, can you answer my previous question about if the experience values are correct after death but before respawn? The answer to that question will determine how I will proceed with possible solutions.
I've attempted a fix in the latest build, although I still can't reproduce this bug in any way so my hands are a bit tied as to how much I can reasonably accomplish. Also, my previous questions have remained unanswered so this issue is a bit stagnant. I'm closing this issue until more detailed information can be given to me about the presence or behavior of this bug or someone else opens up a similar issue.
Apologies, took a break from MC. Will test the new update and let you know if I see the bug again.