mojira.dev
MC-258919

Variable amount of experience for a level

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.

Linked issues

Comments 1

Thank you for your report!
We're tracking this issue in MC-123270, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.

Pardys_

(Unassigned)

Unconfirmed

(Unassigned)

1.19.3

Retrieved