mojira.dev
MC-266724

scoreboard players reset <targets> <objective> no longer works

The scoreboard players reset <targets> <objective> command no longer works. Resetting them for all scoreboards does still seem to work.

Steps to reproduce:

  • Add the scoreboard using /scoreboard objectives add TestScoreboard dummy

  • Give example a score using /scoreboard players set example TestScoreboard 123

  • Reset the score using the following command /scoreboard players reset example TestScoreboard

  • Try to get example's score using /scoreboard players get example TestScoreboard

  • Notice how the score is still present

  • (Alternatively you can use /scoreboard objectives setdisplay sidebar TestScoreboard and see the score being displayed in the sidebar)

Linked issues

Attachments

Comments 1

Simple code analysis (official mappings):
PlayerScores

public boolean remove(Objective objective) {
    return this.scores.get(objective) != null;
{{}}}
This method is used by the Scoreboard to remove a specific objective from a "Player", but the current implementation doesn't remove it.
To actually remove the objective entry from the scores Map, it needs to be replaced with something like this:

public boolean remove(Objective objective) {
    return this.scores.remove(objective) != null;
{{}}}
I have written a simple fabric mod to fix this bug!

ErrorCraft

boq

Community Consensus

Platform

Very Important

Commands

23w46a

1.20.3 Pre-Release 1

Retrieved