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
is duplicated by 2
relates to 2
Comments 7
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"
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.