Commands/trigger

From Minecraft Wiki
Jump to: navigation, search
Information icon.svg
This feature is exclusive to Java Edition.
trigger
Restrictions

None

First introduced

Java Edition 1.8 (14w06a)

Modifies a scoreboard objective with a "trigger" criterion. Allows non-operator players to modify their own scoreboard objectives under tightly controlled conditions. Often used to let players activate systems made by operators or mapmakers.

Syntax[edit]

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[edit]

<objective>: objective

Must be a scoreboard objective name.
An enabled scoreboard objective with the "trigger" criterion.

<value>: integer

Must be a 32-bit integer number. And it must be between -2147483648 and 2147483647 (inclusive).
Specifies the value to be set to or added to the objective.

Result[edit]

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if the objective does not exist Failed
if the objective isn't the "trigger" type
if executor is not a player
if executor isn't on the scoreboard objective.
if the objective has not been "enabled" for the player
On successChanges the value of the objective and the objective is un-enabled for the player.

Output[edit]

CommandEditionSituationSuccess Count/execute store succeess .../execute store result ...
anyJava EditionOn fail000
On success11The score of the objective of the player after the command is executed.

History[edit]

Java Edition
1.814w06aAdded /trigger.