Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheatsAll commands

Switch game

23 Wikis · pick your game
/trigger

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.

Syntax

/trigger <objective> [(add <value>|set <value>)]

Arguments

ArgumentKind of valueWhat to type
<objective>Scoreboard objectiveA scoreboard objective with the trigger criterion. The game suggests the ones currently enabled for you.
<value>Whole numberA whole number: the amount to add after add, or the score to set after set.

Details

Permission level0: every player
Works inNo 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.
ResultReports "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 onlyFails with "You can only trigger objectives that are 'trigger' type" if the objective uses another criterion.
Must be enabled firstFails 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.

Examples

/trigger menu

Adds 1 to your score in the objective menu.

/trigger menu set 3

Sets your score in the objective menu to 3.

/trigger shop add 5

Adds 5 to your score in the objective shop.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)