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

QueryResult for xp command uses previous value

    XMLWordPrintable

    Details

    • Confirmation Status:
      Confirmed

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                marcono1234 [Mod] Marcono1234
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  CHK: