Update Triggers

Ka0rX 2022-08-17 14:59:55 +00:00
parent e89b9b2a22
commit 49548bae88

@ -2,9 +2,25 @@
Triggers are used by MMOCore to execute actions when certain conditions are met. They are used for both quests and professions, and each has a set of actions or objectives that can "trigger" them.
### Trigger Tables (Since 1.9.5)
Since 1.9.5, you can define trigger tables in `triggers.yml`. You can reference each trigger list with its id which will fire all the corresponding triggers.
```
#Example
test-trigger:
- 'command{format="broadcast Triggered!"}'
#Will fire the 2 commands in test-trigger-2
- 'from{source="test-trigger-2"}'
test-trigger-2:
- 'command{format="mmocore admin skill-points give %player% 1"}'
- 'command{format="mmocore admin atr-realloc-points give %player% 3"}'
```
## Available Trigger Types
| Trigger | Description | Format/Example |
|------------|--------------------------------------|-----------------------------------------------------------|
|---------|-------------|----------------|
| from | Fires all the triggers defined in the corresponding section of `triggers.yml`. | `from{source=trigger-id}` |
| message | Sends a message to the player. | `message{format="&aYour message here... "}` |
| command | Makes the console perform a command. | `command{format="tellraw @a {"text":"Hello!"}"}` |
| experience | Gives experience in a profession. | `exp{profession=<PROFESSION>;amount=<AMOUNT>}` |