Mojira Archive
MC-169576

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

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

Duplicate

Joshua Fattarini

2020-01-07, 09:18 PM

2020-12-19, 08:42 AM

2020-12-19, 08:42 AM

2

0

Confirmed

(Unassigned)

1.15.1, 1.16.4

-