PlayersJava

/trigger

The one scoreboard command normal players can run without cheats. An operator enables a 'trigger' objective for a player; the player then runs /trigger to set or add to their own score — the basis for clickable menus and opt-in actions in maps and datapacks.

What is /trigger used for?

What /trigger is for

The one scoreboard command non-operators can run — a player sets or adds to their own enabled trigger objective.

When to use /trigger

Build clickable menus and opt-in actions in maps: an operator enables a trigger, then a /tellraw button runs /trigger for the player.

Syntax

Parameters

objective
objective
A trigger-type objective enabled for you.
modeoptional
literal
add <value> or set <value>. Omit to add 1.

Examples

  • Pick option 1 in a datapack menu.

  • Add 5 to your own points score.

Permission level

/trigger requires All players.