Mojira Archive
MC-254353

A packet to remove the score is always broadcast when a score is reset

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();
}

 

Unresolved

intsuc

2022-07-19, 06:57 AM

2025-01-24, 04:24 PM

9

4

Community Consensus

Low

Platform

Networking, Performance

scoreboard

1.19 - 25w04a1.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, 1.21.4, 25w04a

-