-
Bug
-
Resolution: Duplicate
-
None
-
1.19.3
-
None
-
Unconfirmed
-
(Unassigned)
The bug
Depending on your current amount of experience, reaching a level can be more expensive. This may have been there for a long time, I didn't find any related issue.
Steps to reproduce
Using commands, make sure you have no xp. Then, add 1395 xp. You should be at level 30.
Reproduce the same step, but now add 1394. Then 1. And you should stay at level 29.
Explanation
The way experience is added use the floating value of the xp bar. However, an amount for a level is a definite integer number. Depending on how much experience you're adding, the floating value will or will not round to the next integer. The function should be change to not refer to this floating value, but integer instead.
- duplicates
-
MC-123270 Inconsistent xp and level value
- Resolved