The bug
The number of points on the death screen becomes negative with a very large number of experience levels.
How to reproduce
Enter these commands step by step:
/xp add @s 1999999999 points (10 times)
/kill @s
→ The number of points on the death screen now displays a large negative number (about -1474836390)
Linked issues
Attachments
Comments 30
From what I can see here, this is because of the code behind the /xp command.
1,999,999,999 (What he typed in)
2,147,483,647 (Limit of an int)
Variables initialized in Minecraft 1.5.2's code (may be partially modified, notify me if so)
private int aN;
private int aS;
private aL[][] a;
private boolean t;
private S c;
I don't know if any of that could possibly have anything to do with it, as what he entered is not as big as an int's max value, but I don't know if the command's arguments are stored in an int, possibly a string. It would depend on the command, however.
Honestly, I don't even know what I'm saying, just decided to poke around the code for a bit and see what I could come up with.
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.
(Automatic Message)
Confirmed.