Minecraft Wiki

The Minecraft Wiki is no longer considered as official by Microsoft and therefore several changes are required to be made, including to the wiki's logo. Please read this announcement for more information.

READ MORE

Minecraft Wiki
Advertisement
Information icon.svg
This feature is exclusive to Java Edition. 
trigger
Permission level
required

0

Restrictions

None

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

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

CommandTriggerJava Edition
anythe 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
On successChanges the value of the objective and the objective is un-enabled for the player.

Output[]

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

History[]

Java Edition
1.814w06aAdded /trigger.
Advertisement