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

Xp Query can be 1 off. XpTotal isn't always accurate.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.15.1, 1.16.4
    • None
    • Windows 10
    • Confirmed
    • (Unassigned)

      Starting from 0 levels and xp, I do 

      /xp set @s 10 levels

      which is a total of 160 pts. I then use

      /xp add @s -100 points

      then

      /xp query @s points

      , and it tells me I have 4 points while I can see that I have 5 levels which is a total of 59 points, which doesn't make sense because 160-100 doesn't = 59.

      After this, I subtract 4 levels and the query tells me I have 0 points, yet there's a green notch filled at the bottom. Subtracting 1 again gives puts me at level 4 with the entire green bar filled up.

      If I start from 0 levels and xp and do

      /xp set @s 5 levels

      the query says I have 0 points and the green notch isn't filled.

       

      This is bad because storing the result of the query in the score can be 1 off and XpTotal doesn't always accurately show the total Xp. "xp" can be used as a criteria for a score, but it doesn't take into account the Xp a player already had before being assigned and it also doesn't update from certain commands like

      /xp set <target> # levels

            Unassigned Unassigned
            ryu3025 Joshua Fattarini
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: