The bug
The XP level can overflow causing the experience bar to disappear.
How to reproduce
Type
/xp set @s 2147483647 levels
. Now your level is 2147483647.Type
/xp add @s 1 levels
. XP disappears from display.Type
/xp add @s 1 levels
again. Now your level is 1.
So, maximum player's level is 2^31 - 1, after which the level overflows and is treated as 0. The possible solution (suggested by @unknown) is to cap maximum level.
Linked issues
is duplicated by 5
relates to 2
Attachments
Comments 44
Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.
this is because of the 32 signed bit integer limit (2,147,483,647) after this number the game automaticly resets your level to 1. this happends because of the way how the xp level is stored
@unknown Could you please not go through tons of tickets, making either obvious/redundant (MC-201, MC-1531, MC-3266, MC-1673, …) or incorrect (MC-180, MC-212, MC-2157, MC-2112, MC-2791, MC-1297, …) statements? I got lots of mails from your comments over night, followed by a bunch of mails of people correcting you. Please only contribute if you actually have new and relevant information, not baseless speculation. Also, if you want go through all currently open bugs, prepare some meals first, because you'll need a really long time for 8375 reports…
I think the solution here is not to make this an unsigned int, but to simply cap the max level so it doesn't happen.