/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.
Created Issue:
/trigger does not work with scores that have not been assigned a value
I'm actually not sure if this is a bug, but it seems pretty silly to keep this way.
How to reproduce:
/scoreboard objectives add someObjective trigger
/trigger someObjective set 1Will print "Invalid trigger name someObjective" in chat. Giving the objective a value will make it work:
/scoreboard players set @p someObjective 0
/trigger someObjective set 1Will set someObjective to 1 for me.
I'm actually not sure if this is a bug, but it seems pretty silly to keep this way.
How to reproduce:
/scoreboard objectives add someObjective trigger
/trigger someObjective set 1Will print "Invalid trigger name someObjective" in chat. Giving the objective a value will make it work:
/scoreboard players set @p someObjective 0
/trigger someObjective set 1Will set someObjective to 1 for me.
How to reproduce:
/scoreboard objectives add someObjective trigger
/trigger someObjective set 1Will print "Invalid trigger name someObjective" in chat. Giving the objective a value will make it work:
/scoreboard players set @p someObjective 0
/trigger someObjective set 1Will set someObjective to 1 for me.
—
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 1Will print "Invalid trigger name someObjective" in chat.
Giving the objective a valuewill make it work:/scoreboard players set @p someObjective 0
/trigger someObjective set 1Will set someObjective to 1 for me.
—
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 1Will 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 1Will set someObjective to 1 for me.
—
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 1Will 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 1Will set someObjective to 1 for me.
—
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 1Will 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 1Will set someObjective to 1 for me.
—
If this is no bug, tab-completing the objective argument on /trigger should not return invalid objectives.
A comment with security level 'global-moderators' was removed.
/triggerdoes not work with scores that have not been assigned a value/trigger prints incorrect error message for players who do not have a score for an objective
How to reproduce:
/scoreboard objectives add someObjective trigger /trigger someObjective set 1Will 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 1Will set someObjective to 1 for me.
—
If this is no bug, tab-completing the objective argument on /trigger should not return invalid objectives.
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 1Will 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 1Will set someObjective to 1 for me.
relates to
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.