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

Scoreboard objectives lost (not updated when converting a world to version with renamed stats)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.14.2, Minecraft 1.14.3, 1.14.4, 1.17.1, 1.18 Release Candidate 3, 1.18.1
    • Windows 7 64 Bit Ultimate
      Service Pack 1

      java version "1.8.0_51"
      Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
      Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
    • Confirmed
    • Datafixer

      I noticed a bug when I tried to play my world in the latest version (currently world is saved in version 1.12.2).
      Problem is that the most Scoreboard values are not showing.

      After checking the scoreboard.dat in nbt-explorer I discovered what the problem is:

      In 1.14.x names and structure of the stats-file changed, so the stats must now be accessed with a different name / path.
      The scoreboard file seems to be not updated when opening the world, and in still contains the old names, which are now "invalid".

      Expected behavior:

      • When opening a older world in version 1.14.x, the scoreboards should be displayed like before updating the world

      Actual behavior:

      • Scoreboard file is untouched from the update
      • All "old" stats-names in the scoreboard-file are not "invalid" and they are removed the next time you execute any /scoreboard- command
      • Result is, that the invalid objective-names are not shown in 1.14 (or higher) version of this world
      • When you try to add or modify objectives the "old" will be completely removed from the scoreboard.dat what results in loosing your statistics

      How to test:

      • Create or open any world saved before version 1.13
      • Create any scoreboard objectives and assign displayslot
      • leave the world and restart game in the latest version (or any other affected version)
      • open and/or convert the world to this version
      • check your scoreboard (look at your screen), and you will see nothing, try
        /scoreboard objectives list

        and all objectives (which are no dummy objectives) will be gone

      How to fix:

      • When opening scoreboard file check if it contains a "DataVersion"
      • if it does NOT contain this, it is saved before 1.14 and needs update
      • To Update the files simply walk overall objectives and check for old stat names and replace them to the new syntax of 1.14
        e.g. replace
        • stat.leaveGame

          to

          minecraft.custom:minecraft.leave_game
        • stat.mineBlock.minecraft.iron_ore

          to

          minecraft.mined:minecraft.iron_ore

       

      I tried to use the "optimize world" Option with a backup of my world, the result was the same, Scoreboard file was NOT Updated.

      I made another test with the minecraft-server.jar--> same issue, scoreboard is not updated.

       

      Update: 

      Steps to reproduce in 1.16:

       

      • Open or Create a World in any version below 1.16 and run:
      • /scoreboard objectives add Pigman minecraft.killed:minecraft.zombie_pigman
        /scoreboard objectives setdisplay sidebar Pigman
        /scoreboard players add @p Pigman 1 

        You will see the scoreboard for your player on the sidebar

      • Close game, and open the world in 1.16 (e.g. 1.16.5)
      • You will see, scoreboard is no longer shown
        run 
        /scoreboard players list @s 

        A message shows "Error while executing the command"

      • After you leave the world the scoreboard entry will be removed from your scoreboard.dat

       

      The reason is for this error is just simple: when a Item (or Monster) that was used in a scoreboard is renamed in an update (like zombie_pigman and zombified_piglin in 1.16) the scoreboard objective becomes invalid.

            Unassigned Unassigned
            Radon8472 Radon8472
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: