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
:
Download
and notice that it contains two objectives, Test (dummy) and Fall (
stat.fallOneCm
), and there are scores on both objectivesCreate a world and put
scoreboard_INVALID.dat
into the data folder, and rename it to "scoreboard.dat"Join the world, and run
/scoreboard objectives setdisplay sidebar Test
Run
/scoreboard players set test2 Test 1
Run
/scoreboard objectives add Foo dummy
Do any additional scoreboard changes you wish
Notice that the sidebar now displays the objective and a score
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
:
Download
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.
Create a world and put
scoreboard_VALID.dat
into the data folder, and rename it to "scoreboard.dat"Join the world, and run
/scoreboard objectives setdisplay sidebar Test
Run
/scoreboard players set test2 Test 1
Run
/scoreboard objectives add Foo dummy
Do any additional scoreboard changes you wish
Notice that the sidebar now displays the objective and a score
Exit and rejoin the world, notice that all scoreboard changes are still present and nothing has reverted
Linked issues
is duplicated by 14
relates to 2
Attachments
Comments 5
Do a copy of the world and delete in the folder data "scoreboard.dat". Readd the scoreboard objectives. This should fix it (temorarly).
The issue must be that the game doesn't recognize the old format of the stats that were changed and does not know how to handle it, thus causing bugged, unexpected behavior to occur. It's likely that this has always been an underlying issue that only surfaced now because some of the stat formats were changed. Hopefully this gets fixed because it can break a lot of pre 1.13 worlds that rely heavily on scoreboard objectives. Deleting the "scoreboard.dat" file may solve the issue, but you would have to take note of every single score that each player has for every objective that exists. On a multiplayer server this would just be impractical, and on a single player world with several objectives it would just be inconvenient.
same in 18w02a