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

Scores on scoreboard objectives created with old stats causes scoreboards to not store changes to scoreboard.dat

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 1.13-pre3
    • Minecraft 17w49b, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w02a, Minecraft 18w03b, Minecraft 18w06a, Minecraft 18w20c, Minecraft 18w21b, Minecraft 18w22c, Minecraft 1.13-pre1
    • Confirmed

      The bug

      If there is a score on a scoreboard objective created with pre-1.13 stats, for example stat.fallOneCm, scoreboards malfunction. Specifically, when this occurs, any changes to scoreboards during a play session are not stored to scoreboards.dat, and rejoining the world reverts all changes to their initial state. For example, if you open a world with a score on an objective based on stat.fallOneCm, then if you try to set your score, create or remove objectives, or change the sidebar display, etc., rejoining the world reverts all changes to how they were as if you never changed anything at all.

      Logged error when saving (17w50a)
      java.lang.NullPointerException
          at bmo.a(SourceFile:348)
          at java.util.HashMap$Values.forEach(Unknown Source)
          at bmo.a(SourceFile:345)
          at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
          at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
          at java.util.HashMap$ValueSpliterator.forEachRemaining(Unknown Source)
          at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
          at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
          at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
          at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
          at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
          at java.util.stream.ReferencePipeline.forEach(Unknown Source)
          at bmo.i(SourceFile:344)
          at bmp.b(SourceFile:148)
          at bjz.a(SourceFile:95)
          at bjz.a(SourceFile:81)
          at qt.a(SourceFile:915)
          at qt.a(SourceFile:867)
          at net.minecraft.server.MinecraftServer.a(SourceFile:411)
          at clm.v(SourceFile:142)
          at net.minecraft.server.MinecraftServer.run(SourceFile:497)
          at java.lang.Thread.run(Unknown Source)
      

      How to reproduce

      With invalid scoreboard.dat:

      1. Download scoreboard_INVALID.dat and notice that it contains two objectives, Test (dummy) and Fall (stat.fallOneCm), and there are scores on both objectives
      2. Create a world and put scoreboard_INVALID.dat into the data folder, and rename it to "scoreboard.dat"
      3. Join the world, and run
        /scoreboard objectives setdisplay sidebar Test
        
      4. Run
        /scoreboard players set test2 Test 1
        
      5. Run
        /scoreboard objectives add Foo dummy
        
      6. Do any additional scoreboard changes you wish
      7. Notice that the sidebar now displays the objective and a score
      8. Exit and rejoin the world, notice that all scoreboard changes have reverted, the sidebar has cleared, test2's score doesn't exist, and the Foo objective no longer exists

      With valid scoreboard.dat:

      1. Download scoreboard_VALID.dat and notice that it only contains objective Test (dummy) and a score on the objective. I have removed the Fall objective and all scores related to it.
      2. Create a world and put scoreboard_VALID.dat into the data folder, and rename it to "scoreboard.dat"
      3. Join the world, and run
        /scoreboard objectives setdisplay sidebar Test
        
      4. Run
        /scoreboard players set test2 Test 1
        
      5. Run
        /scoreboard objectives add Foo dummy
        
      6. Do any additional scoreboard changes you wish
      7. Notice that the sidebar now displays the objective and a score
      8. Exit and rejoin the world, notice that all scoreboard changes are still present and nothing has reverted

        1. scoreboard_INVALID.dat
          0.2 kB
          Onnowhere
        2. scoreboard_VALID.dat
          0.2 kB
          Onnowhere

            fry [Mojang] Georgii Gavrichev
            onnowhere Onnowhere
            Votes:
            17 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: