![]() |
VOOZH | about |
/trigger| Permission level required |
0 |
|---|---|
| Restrictions | None |
{
"title": "<code>/trigger</code>",
"rows": [
{
"field": "0",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "None",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Changes the executor player's score in a scoreboard objective with a "trigger" criterion, and un-enables the objective for this player. Allows non-operator players to modify their own scoreboard objectives under tightly controlled conditions. Often used to let players activate systems controlled by data packs or command blocks.
trigger <objective>
1 to the current value of <objective>.trigger <objective> add <value>
<value> to the current value of <objective>.trigger <objective> set <value>
<objective> to <value>.<objective>: objective
-, +, ., _, A-Z, a-z, and 0-9) It resolves into a scoreboard objective during command execution.<value>: integer
| Command | Trigger | Java Edition |
|---|---|---|
| Any | the arguments are not specified correctly | Unparseable |
| the objective does not exist | Failed | |
| the objective isn't the "trigger" type | ||
| the executor is not a player | ||
| the executor isn't on the scoreboard objective. | ||
| the objective has not been "enabled" for the player | ||
| Otherwise | Successful |
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On fail | 0 | 0 | 0 |
| On success | 1 | 1 | The objective's score of the player after the command is executed. |
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.8 | 14w06a | Added /trigger. | |||||
| 1.13 | 17w45a | Added /trigger <objective> as a new syntax as a shortcut for /trigger <objective> add 1. | |||||