mojira.dev
MC-107049

Enabling uninitialized trigger also sets score to 0

The bug

When you enable a trigger scoreboard objective for a player who has no score for it yet, the value is initialized to 0. This can cause problems if you use 0 as a value for an action.

The use for it might be to tell that a trigger objective was enabled, but in this case any scoreboard command changing the value before the test happens negates this use.

How to reproduce

  1. /scoreboard objectives add triggerObjective trigger

  2. /scoreboard players list @p
    triggerObjective is not shown

  3. /scoreboard players enable @p triggerObjective

  4. /scoreboard players list @p
    triggerObjective is shown with a value of 0

Additional comment

Linked issues

Comments 6

Might be invalid or works by design.

The score objective has a field for whether it is locked or not. If a player has no score, he also does not have a score objective. A state in which the player has a score objective but no score currently sadly does not exist.

Fixed in 1.11.2 at the latest.

Misunderstood the report. Not fixed, but WAI per the fix of MC-79255.

...leaving open for an explicit dev decision.

There is no such thing as an uninitialized but enabled score. If a score doesn't exist, it can't have properties.

marcono1234

Nathan Adams

Confirmed

objective, score, scoreboard, trigger

Minecraft 1.10.2, Minecraft 16w36a, Minecraft 1.12.2, Minecraft 18w03b

Retrieved