This feature is exclusive to Java Edition.
Changes the executor player's score in a scoreboard objective with a "trigger" criterion, and un-enabled 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.
Syntax[]
trigger <objective>
- Adds
1
to the current value of<objective>
.
trigger <objective> add <value>
- Adds
<value>
to the current value of<objective>
.
trigger <objective> set <value>
- Sets the value of
<objective>
to<value>
.
Arguments[]
<objective>
: objective
- An enabled scoreboard objective with the "trigger" criterion.
- It must be a valid scoreboard objective name.
<value>
: integer
- Specifies the value to be set to or added to the objective.
- Must be a 32-bit integer number.
Result[]
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 |
Output[]
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. |
History[]
Java Edition | |||||
---|---|---|---|---|---|
1.8 | 14w06a | Added /trigger . |