Mojira Archive
MC-103895

QueryResult for xp command uses previous value

The bug

When you use the QueryResult stat in combination with the /xp command, the query result value is the previous value. This affects adding / removing experience and adding / removing levels.

How to reproduce

  1. /scoreboard objectives add xpLevels dummy
  2. /scoreboard objectives setdisplay sidebar xpLevels
  3. /scoreboard players set @p xpLevels 0
  4. /stats entity @p set QueryResult @p xpLevels
  5. /xp 1L
    → The score has your previous xp level count as value

The reason

The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

The reason for this is that the method net.minecraft.command.CommandXP.execute(MinecraftServer, ICommandSender, String[]) first sets the query result value and then changes the experience value.

Invalid

Marcono1234

2016-06-20, 04:41 PM

2020-08-07, 07:16 PM

2020-01-10, 12:29 AM

0

3

Confirmed

(Unassigned)

QueryResult, command, experience, level, stats

Minecraft 1.10, Minecraft 1.11.2, Minecraft 17w06a

-