Skip to content

Triggers

Eufranio edited this page May 31, 2020 · 8 revisions

Triggers are what runs the quests for players, and they can be tied to a block or entity, and be triggered on walk, right click, or left click. Triggers have also the option to cancel (or not) the action that triggered it, a right click for example. You can view all current triggers and TP/delete them by using /pbq triggers:

Event Types

Event types are what kind of event the Trigger should listen to. They can be WALK, CLICK, RIGHT_CLICK, LEFT_CLICK or NPC. CLICK refers to both right and left clicks.

Cancel Original Action

Triggers can cancel the original actions when running a quest. If cancel = true, the events that it listen to will be cancelled, and if cancel = false the events will NOT be cancelled, allowing posterior actions. When not specified in the /pbq addQuest command it defaults to true.

Trigger Types

Entity Triggers

Entity triggers are triggers that run their associated quest when an entity is right clicked. To assign an trigger to an entity, run /pbq addQuest <quest line> <quest id> <event type> [<cancel action>] while looking to an entity, which will be your NPC. Entity triggers support only the NPC event type.

Block Triggers

Block triggers are triggers that run their quest when a block is walked in, right or left clicked. To assign an trigger to an block, run /pbq addQuest <quest line> <quest id> <event type> [<cancel action>]. Block triggers support only the different CLICK event types.

NPCs

PBQ can also spawn basic NPCs that you can assign quests to. Simply use /pbq spawn <type> while looking at a block to spawn an NPC on top of it. type should be the entity type of the NPC, like minecraft:villager.

You can also rename NPCs with /pbq rename <new name> while looking at the NPC.