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

XpTotal value used as value for xp scoreboard objectives and query result of xp command is never decreased and does not change when the experience level changes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.11.2, Minecraft 1.12 Pre-Release 6, Minecraft 1.13.2, Minecraft 19w08b, Minecraft 19w09a, Minecraft 1.14.3
    • Fix Version/s: None
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      The bug

      The value of the XpTotal tag of a player which is used as value for scoreboard objectives of the criteria type xp and the query result of the /xp command when giving experience (not levels) does not account for level changes.
      It is basically the number of experience the player has collected. It only resets to 0 when the player would have a negative experience level.

      How to reproduce

      1. Create a scoreboard objective tracking the xp of a player
        /scoreboard objectives add xp xp
        /scoreboard objectives setdisplay sidebar xp
        
      2. Use for example the /xp command
        /xp 1L
        

      Code analysis

      Based on 1.11.2 decompiled using MCP 9.35 rc1

      The tag XpTotal (field net.minecraft.entity.player.EntityPlayer.experienceTotal) is only increased by the method net.minecraft.entity.player.EntityPlayer.addExperience(int) and additionally never decreased.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Wilux00@gmail.com Wilux Dahlqvist
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  CHK: