
Command
/trigger
Lets a player change their own score in a scoreboard objective of the trigger type, which map makers use to let players without operator rights send input.
| /trigger <objective> [(add <value>|set <value>)] |
| Argument | Kind of value | What to type |
|---|---|---|
| <objective> | Scoreboard objective | A scoreboard objective with the trigger criterion. The game suggests the ones currently enabled for you. |
| <value> | Whole number | A whole number: the amount to add after add, or the score to set after set. |
| Permission level | 0: every player |
| Works in | No permission level is required (level 0), so every player can use it in singleplayer and on servers. It must be run by a player, so the server console and command blocks can only use it through /execute as a player. |
| Result | Reports "Triggered" with the objective name and, for add and set, the amount. Returns the player's new score for the plain form and for add, and the given value for set. |
| No add or set | /trigger <objective> on its own adds 1 to the score. |
| Trigger objectives only | Fails with "You can only trigger objectives that are 'trigger' type" if the objective uses another criterion. |
| Must be enabled first | Fails with "You cannot trigger this objective yet" until the objective has been enabled for that player with /scoreboard players enable. Each successful use disables it again, so it has to be enabled again before the next use. |
/trigger menuAdds 1 to your score in the objective menu.
/trigger menu set 3Sets your score in the objective menu to 3.
/trigger shop add 5Adds 5 to your score in the objective shop.

