/trigger
Let non-op players change their own enabled objective score.
Overview
What is the /trigger command?
The /trigger command is the one scoreboard command non-operators are allowed to run, letting map makers offer safe player interactions like clickable chat menus and shop buttons. A player can only trigger objectives an operator has enabled for them.
It's the bridge that lets ordinary players 'press buttons' in a datapack without giving them full command access.
When to use it: Use /trigger to let non-op players safely activate map features โ menus, shops, votes โ via enabled trigger objectives.
At a glance
Syntax
/trigger <objective> [add|set] [value]See it
What it does
Anatomy
Every part, explained
- 1
CommandRequired/triggerChanges a trigger objective for yourself.
- 2
ObjectiveRequired<objective>A trigger-type scoreboard objective.
- 3
ModeOptional[add|set]Add to or set the value.
- 4
ValueOptional[value]The number to add or set.
Your turn
Try it yourself
Copy & paste
Examples
/trigger myObjective add 1Add 1 to your trigger.
/trigger myObjective set 5Set your trigger to 5.
/trigger myObjectiveFire the trigger once.
Avoid these
Common mistakes
/trigger myObjective add/trigger myObjective add 1Add and set need a number.
/trigger @s myObjective add 1/trigger myObjective add 1Trigger only affects yourself, no target.
Good to know
Frequently asked questions
- What does /trigger do in Minecraft?
- It lets a player modify a special 'trigger' scoreboard objective they've been granted, enabling safe interactions without op permissions.
- Why does /trigger say I can't use that objective?
- The objective must be of the trigger type and enabled for you with /scoreboard players enable. Until then, /trigger is blocked.
- How do map makers use /trigger?
- They show clickable text that runs /trigger, so players can pick options or buy items while a datapack reads the value.
Keep going