Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-258281

Slight experience glitch in Java 1.19.2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • 1.19.2
    • None
    • Unconfirmed
    • (Unassigned)

      There seems to be a glitch where your experience value is listed as exactly and only 1 less than what it actually is. I found this out with the help of a data pack I coded that makes you drop all of your experience on death, but this could be replicated without it and I will explain when that is possible since I have tested that option. Here is a summary of what is happening in my photos:


      1. I have given myself 100 xp with the command "/xp add @s 100 points". Using my data pack, the amount is shown as a score in the sidebar slot on my screen.

      2. I have just used "/kill @s" to drop my experience and the command I will run will show the value of all experience orbs in the world. You could also summon the same experience orbs in the next picture with the same values using commands. I have done this and had the same problem at about the same frequency listed in my important notes.

      3. After using the command in picture 2, you can see that the total value of all experience orbs is 100. Zooming in also shows that there are indeed 6 experience orbs (one is behind another so it looks like a 45 degree rotated bowtie), so there is not another experience orb somewhere else in the world with value 1 that would cause this problem.

      4. After collecting those experience orbs, I now only have 99 experience. Using "/xp query @s levels" and "/xp query @s points", you can see that I have 7 levels and 8 points. Even without my data pack, this can be shown to be an issue. The formula for calculating experience based on these values is on the minecraft wiki and is:

      L^2 + 6L + P (for levels 0-16)
      Where L is your level and P is your points. Using L = 7 and P = 8, this formula equals 49 + 42 + 8 which equals 99. However, there was 100 experience picked up as noted by picture 3, so P should be 9.

      IMPORTANT NOTES

      • The problem does not happen 100% of the time, only a majority of the time (around 80-90% of the time)
      • The problem most often occurs when you pick up experience orbs. Getting experience through commands usually works, but I had one time where it did not.
      • I have been working with this type of data pack (and therefore experience mechanics) since version 1.17 and I believe that this issue has only started being a problem in Java version 1.19.2. I am certain that 1.19.1 did not have this issue.
      • I also noticed that my experience above my hotbar sometimes had the correct amount listed visually, but was wrong when using commands. For example, if I had absorbed experience orbs with total value 92, my hotbar would show 7 levels and a bit of my experience bar colored in, which is correct. When using commands, my level was 7 and my points were 0 (corresponding with exactly level 7 from the math), so this would mean that I should have no colored part in my experience bar at all.
      • Link to video (with no use of data pack to summon orbs and same values listed above): https://youtu.be/_ZoN6h-iXuM

        1. 2022-12-04_01.00.10.png
          2022-12-04_01.00.10.png
          520 kB
        2. 2022-12-04_00.59.40.png
          2022-12-04_00.59.40.png
          667 kB
        3. 2022-12-04_00.58.56.png
          2022-12-04_00.58.56.png
          637 kB
        4. 2022-12-04_00.58.33.png
          2022-12-04_00.58.33.png
          391 kB

            Unassigned Unassigned
            astrune astrune
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: