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
- /scoreboard objectives add triggerObjective trigger
- /scoreboard players list @p
→ triggerObjective is not shown - /scoreboard players enable @p triggerObjective
- /scoreboard players list @p
→ triggerObjective is shown with a value of 0
2016-09-15, 06:35 PM
2023-11-16, 07:28 PM
2018-01-23, 04:11 PM
4
2
objective, score, scoreboard, trigger
Minecraft 1.10.2, Minecraft 16w36a, Minecraft 1.12.2, Minecraft 18w03b
-