diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java index c7ca6210d6..f3184be385 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java @@ -87,8 +87,8 @@ public final class CraftScoreboardManager implements ScoreboardManager { // Old objective tracking HashSet removed = new HashSet<>(); - for (int i = 0; i < 3; ++i) { - Objective scoreboardobjective = oldboard.getDisplayObjective(net.minecraft.world.scores.DisplaySlot.BY_ID.apply(i)); + for (net.minecraft.world.scores.DisplaySlot slot : net.minecraft.world.scores.DisplaySlot.values()) { // Paper - clear all display slots + Objective scoreboardobjective = oldboard.getDisplayObjective(slot); // Paper - clear all display slots if (scoreboardobjective != null && !removed.contains(scoreboardobjective)) { entityplayer.connection.send(new ClientboundSetObjectivePacket(scoreboardobjective, 1)); removed.add(scoreboardobjective);