mojira.dev
MC-48488

/trigger prints incorrect error message for players who do not have a score for an objective

The bug

Using /trigger for a player who has no score for an objective (see MC-79255) shows the error message commands.trigger.invalidObjective:

Invalid trigger name [objective name]

This is pretty misleading and should instead be something like

The player [player name] has no score entry for the objective [objective name]

If this is no bug, tab-completing the objective argument on /trigger should not return invalid objectives.

How to reproduce

/scoreboard objectives add someObjective trigger
/trigger someObjective set 1

Will print "Invalid trigger name someObjective" in chat. Note that trigger objectives that aren't enabled print a different message: "Trigger someObjective is not enabled". Giving the objective a value or enabling its trigger for the player will make it work:

/scoreboard players set @p someObjective 0
/trigger someObjective set 1

Will set someObjective to 1 for me.

Linked issues

Comments 7

You have to enable a trigger objective before it can be set by /trigger.
Do do that you must type /scoreboard players enable @p someObjective.
Now /trigger will work even if you haven't set the objective with "/scoreboard players set @p someObjective 0".
A trigger objective will be disabled for the specific player once you called /trigger, so you have to enable it every time if you want to give someone the permission to change the trigger value.

What I think this bug really is, is that if you call /trigger while neither the objective has an assigned value nor it has been enabled, the error message will be "Invalid trigger name someObjective" instead of "Trigger someObjective is not enabled".
The second bug is that if you set the value of a trigger objective with "/scoreboard players set @p someObjective 0" the trigger gets somehow enabled. Though this only works the first time.

Is this still a concern in the current Minecraft version 14w21b / Launcher version 1.4.4 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Confirmed for 14w25b

Probably the text is just incorrect because it should be like Quijx said instantly "Trigger someObjective is not enabled" and not first "Invalid trigger name someObjective"

Confirmed for 1.8.1.

Still present in 1.8.8 - but appears to be fixed in 15w33c.

I was able to reproduce in 15w33c.

Just hmm it works as designed. I designed it this way. It's a requirement. WHAAAAAA
WHAAAAAA \o/ You didn't finish the sentence. Works this way because Grum stinks.

[Mod] redstonehelper

michael

Confirmed

objective, scoreboard, trigger

Minecraft 14w07a, Minecraft 14w32d, Minecraft 14w33a, Minecraft 14w33b, Minecraft 14w33c, ..., Minecraft 1.8.8, Minecraft 15w33b, Minecraft 15w33c, Minecraft 15w40b, Minecraft 17w06a

Retrieved