A trigger lets a Quest react to things that happen while a player has it active. You bind a trigger to an action, and when the trigger fires, that action runs.
For example: add a DEATH trigger to a Quest, and the moment the player dies, the bound action runs β maybe failing the Quest, maybe spawning some mobs, maybe sending a cheeky taunt. Up to you.
A trigger always runs a pre-defined action. You create actions with /qa/qaAdmin commands for NotQuestsactionsactionsManages saved actions, inline actions, and action execution. (see the Actions page) and can reuse the same action across many triggers and quests.
You add a trigger to a quest like this:
/qa/qaAdmin commands for NotQuestsediteditOpens subcommands for editing a specific quest.<questName><questName>Identifier of the quest to edit; use /qa list to see available quests.Acceptsquest nametriggerstriggersManages triggers attached to this quest.addaddAdds a trigger that runs an action when the selected quest changes state.<actionName><actionName>Action which will be executed when the trigger runs.Acceptssaved action name<TYPE><TYPE>Runs the selected action after the quest player dies the configured number of times.ExampleDEATH...More command inputFull command/qa edit questName triggers add actionName DEATH 1 --applyOn O1 --world_name ALL(flags)--applyOnQuest or objective target this trigger, action, or condition should apply to, such as Quest, O1, or O2.Acceptsquest or objective target
<actionName> - the action to run when the trigger fires.
<TYPE> - when it fires (see the list below).
(extra args) - some types need an extra value, like a world name or a death count.
(flags) - optional, and shared by every type:
--applyOn <objectiveID> - only fire while a specific objective is active. 0 (or Quest, the default) means the whole quest β fire as long as the quest is active. 1 (or O1) means only while objective 1 is active, and so on.
--world_name <world> - only fire in this world. Defaults to ALL (any world).
What `--applyOn` is good for
This is what makes triggers flexible. Say objective 2 is hidden until objective 1 is done. Set --applyOn 2 and the trigger only watches once the player reaches objective 2. Leave it off (or 0) and it watches for the whole quest. Pretty flexible, eh?
For the counted types (DEATH, DISCONNECT, WORLDENTER, WORLDLEAVE, NPCDEATH), the <amount> is how many times it has to happen before the trigger fires. 1 means "fire on the first one".
Let's make a quest fail if the player dies while doing it.
First, create an action that fails the quest:
/qa/qaAdmin commands for NotQuestsactionsactionsManages saved actions, inline actions, and action execution.addaddCreates a new saved action.failQuest<actionName>Name used to save this action.Acceptsaction nameExamplefailQuestFailQuestFailQuestFails another active quest for the target player.test<quest>Active quest that should be failed for the target player.AcceptstextExampletest
Then bind it to a DEATH trigger on the quest test:
/qa/qaAdmin commands for NotQuestsediteditOpens subcommands for editing a specific quest.test<quest>Identifier of the quest to edit; use /qa list to see available quests.Acceptsquest nameExampletesttriggerstriggersManages triggers attached to this quest.addaddAdds a trigger that runs an action when the selected quest changes state.failQuest<action>Action which will be executed when the trigger runs.Acceptssaved action nameExamplefailQuestDEATHDEATHRuns the selected action after the quest player dies the configured number of times.1<amount>Number of player deaths required before this trigger runs.AcceptsintegerExample1
Now, while a player has the test quest active, dying once runs the failQuest action β and the quest fails. Here, failQuest is the action name and DEATH is the trigger type.
Want it to only count deaths in the nether, and only once the player has reached objective 2?
/qa/qaAdmin commands for NotQuestsediteditOpens subcommands for editing a specific quest.test<quest>Identifier of the quest to edit; use /qa list to see available quests.Acceptsquest nameExampletesttriggerstriggersManages triggers attached to this quest.addaddAdds a trigger that runs an action when the selected quest changes state.failQuest<action>Action which will be executed when the trigger runs.Acceptssaved action nameExamplefailQuestDEATHDEATHRuns the selected action after the quest player dies the configured number of times.1<amount>Number of player deaths required before this trigger runs.AcceptsintegerExample1--applyOn--applyOnQuest or objective target this trigger, action, or condition should apply to, such as Quest, O1, or O2.Acceptsquest or objective target2Value for --applyOnQuest or objective target this trigger, action, or condition should apply to, such as Quest, O1, or O2.Acceptsquest or objective targetExample2--world_name--world_nameWorld name filter for world enter/leave triggers, or ALL for every world.Acceptsworld nameworld_netherValue for --world_nameWorld name filter for world enter/leave triggers, or ALL for every world.Acceptsworld nameExampleworld_nether