Affects Version/s: Minecraft 1.12.2, Minecraft 17w50a, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 18w32a, Minecraft 18w33a, Minecraft 1.13.1-pre1, Minecraft 1.13.1, 1.15.1, 1.15.2, 20w10a, 20w27a, 1.16.4, 20w49a, 21w03a, 21w05b
Fix Version/s: None
When the player has 2920 xp, he is supposed to just reach lvl 40, but depending on how you get the amount of xp, you can end up being lvl 39 with a maxed out xp bar.
Use these commands to set up and reset the xp value :
Commands in this order result with lvl 40 :
Commands in this order result with lvl 39 and maxed out xp bar :
This is caused by the experience value still being stored as float and used in calculation, sometimes the condition while(this.experience >= 1.0) is failing when this.experience is barely equals to 1.0 due to float precision error.
Note that no experience points are ever lost in either process.