-
Bug
-
Resolution: Unresolved
-
None
-
1.19, 1.19.1, 1.19.2, 22w42a, 1.19.3 Release Candidate 1, 1.19.3 Release Candidate 2, 1.19.3, 23w03a, 23w05a, 1.19.4 Pre-release 3, 1.19.4, 23w12a, 23w17a, 23w18a, 1.20 Pre-release 7, 1.20.1, 23w31a, 1.20.2, 23w42a, 23w45a, 23w46a, 1.20.4, 24w14a, 24w33a, 1.21.1
-
Community Consensus
-
Networking, Performance
-
Low
-
Platform
The bug
When /scoreboard players reset <targets> is executed or /scoreboard players reset <targets> <objective> resets the last score, a packet to remove the score will be broadcast even if none of the score's objectives is in the tracked objectives. This introduces unnecessary performance overhead to both the server and the clients.
Code analysis
net.minecraft.server.ServerScoreboard
public void onPlayerRemoved(ScoreHolder holder) { super.onPlayerRemoved(holder); // A packet is broadcast unconditionally. this.server.getPlayerList().broadcastAll(new ClientboundResetScorePacket(holder.getScoreboardName(), null)); this.setDirty(); }