@@ -49,9 +50,7 @@ ADD THIS TRIGGER BACK WHEN IT WORKS
...
@@ -49,9 +50,7 @@ ADD THIS TRIGGER BACK WHEN IT WORKS
| onKill | When something kills a mob |
| onKill | When something kills a mob |
-->
-->
Using Triggers
## Using Triggers
--------------
Triggers are defined in the skill section of the mob configuration and
Triggers are defined in the skill section of the mob configuration and
must use a tilde (~) in front of them. In the case of the Timer, a time
must use a tilde (~) in front of them. In the case of the Timer, a time
in ticks is also required.
in ticks is also required.
...
@@ -71,9 +70,7 @@ In this example the mob will also set its target on fire when
...
@@ -71,9 +70,7 @@ In this example the mob will also set its target on fire when
melee-attacking, will use a "FireShield" skill when taking damage, and
melee-attacking, will use a "FireShield" skill when taking damage, and
will use the "AOEFire" skill every 300 ticks, or every 15 seconds.
will use the "AOEFire" skill every 300 ticks, or every 15 seconds.
Not using Triggers...
## Not using Triggers...
---------------------
Skill triggers give far more flexibility in determining exactly when a
Skill triggers give far more flexibility in determining exactly when a
skill should go off. It is **highly** recommended that you trigger all
skill should go off. It is **highly** recommended that you trigger all
your skills using advanced triggers as opposed to the old, legacy
your skills using advanced triggers as opposed to the old, legacy
...
@@ -85,7 +82,6 @@ trigger which will execute when these events occur:
...
@@ -85,7 +82,6 @@ trigger which will execute when these events occur:
- When the mob spawns
- When the mob spawns
- When the mob dies
- When the mob dies
<!-- -->
```yml
```yml
SkeletalWarrior:
SkeletalWarrior:
Mobtype:skeleton
Mobtype:skeleton
...
@@ -96,8 +92,8 @@ SkeletalWarrior:
...
@@ -96,8 +92,8 @@ SkeletalWarrior:
In this instance the Bash skill is triggered when the mob deals or takes
In this instance the Bash skill is triggered when the mob deals or takes
damage when it is between 10% and 90% health.
damage when it is between 10% and 90% health.
The @trigger Targeter
---------------------
# The @trigger Targeter
You may have noticed there is an `@trigger` targeter in the examples
You may have noticed there is an `@trigger` targeter in the examples
shown above, and listed in the [targeters](/Skills/Targeters) section. The `@trigger` will target the
shown above, and listed in the [targeters](/Skills/Targeters) section. The `@trigger` will target the
...
@@ -106,10 +102,10 @@ that mob has an ~onDamaged skill, it will target that player.
...
@@ -106,10 +102,10 @@ that mob has an ~onDamaged skill, it will target that player.
If a signal is being sent to a mob, it will target the mob that sent
If a signal is being sent to a mob, it will target the mob that sent
the signal, and so on.
the signal, and so on.
All Available Triggers
# All Available Triggers
----------------------
#### ~onSpawn
#### ~onSpawn
Executes the skill when the mob spawns. This does not have `@trigger`.
Executes the skill when the mob spawns.
> There is no associated [@trigger]
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CHICKEN
Type:CHICKEN
...
@@ -120,8 +116,9 @@ EXAMPLE_MOB:
...
@@ -120,8 +116,9 @@ EXAMPLE_MOB:
```
```
#### ~onDeath
#### ~onDeath
Executes the skill when the mob dies. The entity that killed the mob is the `@trigger`.<br>
Executes the skill when the mob dies.
If the server is a Paper one, it is possible to cancel the death event as long as the cancelevent mechanic is synched. The health that the mob has after this is based on what is specified in the `ReviveHealth` Option.
If the server is a Paper one, it is possible to cancel the death event as long as the cancelevent mechanic is synched. The health that the mob has after this is based on what is specified in the `ReviveHealth` Option.
> The associated [@trigger] is the entity that killed the caster
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CHICKEN
Type:CHICKEN
...
@@ -146,7 +143,7 @@ ImmortalCow:
...
@@ -146,7 +143,7 @@ ImmortalCow:
```
```
#### ~onAttack
#### ~onAttack
Executes the skill when the mob attacks an entity.
Executes the skill when the mob attacks an entity.
The `@trigger` is the entity that took damage from the attack.
> The associated [@trigger] is the entity that was attacked
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CHICKEN
Type:CHICKEN
...
@@ -158,7 +155,8 @@ EXAMPLE_MOB:
...
@@ -158,7 +155,8 @@ EXAMPLE_MOB:
```
```
#### ~onDamaged
#### ~onDamaged
Executes the skill when the mob takes damage. The `@trigger` is the attacker.
Executes the skill when the mob takes damage.
> The associated [@trigger] is the entity that dealt the damage
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CHICKEN
Type:CHICKEN
...
@@ -170,6 +168,7 @@ EXAMPLE_MOB:
...
@@ -170,6 +168,7 @@ EXAMPLE_MOB:
#### ~onDespawn
#### ~onDespawn
Executes the skill when the mob despawns.
Executes the skill when the mob despawns.
> The associated [@trigger] is the caster itself
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CHICKEN
Type:CHICKEN
...
@@ -180,9 +179,10 @@ EXAMPLE_MOB:
...
@@ -180,9 +179,10 @@ EXAMPLE_MOB:
```
```
#### ~onExplode
#### ~onExplode
Executes the skill when the mob explodes. mobGriefing gamerule must be set to true for this to work.
Executes the skill when the mob explodes.
Generally, this trigger only works with creepers and TNTs since other mobs tend to not explode...
`mobGriefing` gamerule must be set to true for this to work.
Won't work if you have the mobGriefing gamerule set to false.
Generally, this trigger only works with creepers and TNTs since other mobs tend to not explode...
> There is no associated [@trigger]
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CREEPER
Type:CREEPER
...
@@ -193,7 +193,8 @@ EXAMPLE_MOB:
...
@@ -193,7 +193,8 @@ EXAMPLE_MOB:
```
```
#### ~onTeleport
#### ~onTeleport
Executes the skill when the mob teleports.
Executes the skill when the mob teleports.
> There is no associated [@trigger]
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:ENDERMAN
Type:ENDERMAN
...
@@ -205,8 +206,10 @@ EXAMPLE_MOB:
...
@@ -205,8 +206,10 @@ EXAMPLE_MOB:
#### ~onTimer:[tick(s)]
#### ~onTimer:[tick(s)]
Executes the skill every *n<sup>th</sup>* ticks. Ticks can't be zero and 20 ticks is equal to 1 second.
Executes the skill every *n<sup>th</sup>* ticks. Ticks can't be zero and 20 ticks is equal to 1 second.
**Care must be taken when using this trigger as it can lead to server/client performance issues.**
> Care must be taken when using this trigger as it can lead to server/client performance issues!
**i.e. large amounts of particle effects can cause client lag, or can kick the client from the server**
>i.e. large amounts of particle effects can cause client lag, or can kick the client from the server
> There is no associated [@trigger].
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CHICKEN
Type:CHICKEN
...
@@ -218,7 +221,8 @@ EXAMPLE_MOB:
...
@@ -218,7 +221,8 @@ EXAMPLE_MOB:
```
```
#### ~onPlayerKill
#### ~onPlayerKill
Executes the skill when the mob kills a player.
Executes the skill when the mob kills a player.
> The associated [@trigger] is the player that has been killed
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CHICKEN
Type:CHICKEN
...
@@ -229,7 +233,8 @@ EXAMPLE_MOB:
...
@@ -229,7 +233,8 @@ EXAMPLE_MOB:
```
```
#### ~onEnterCombat
#### ~onEnterCombat
Executes the skill when the mob enters combat. **REQUIRES [ThreatTables] to be enabled**
Executes the skill when the mob enters combat. **REQUIRES [ThreatTables] to be enabled**
> The associated [@trigger] is the entity that made the caster enter combat
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CHICKEN
Type:CHICKEN
...
@@ -242,7 +247,8 @@ EXAMPLE_MOB:
...
@@ -242,7 +247,8 @@ EXAMPLE_MOB:
```
```
#### ~onDropCombat
#### ~onDropCombat
Executes the skill when the mob drops combat. **REQUIRES [ThreatTables] to be enabled**
Executes the skill when the mob drops combat. **REQUIRES [ThreatTables] to be enabled**
> There is no associated [@trigger]
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CHICKEN
Type:CHICKEN
...
@@ -268,7 +274,8 @@ EXAMPLE_MOB:
...
@@ -268,7 +274,8 @@ EXAMPLE_MOB:
```
```
#### ~onInteract
#### ~onInteract
Executes the skill when a player interacts with, or *right-clicks*, the mob.
Executes the skill when a player interacts with, or *right-clicks*, the mob.
> The associated [@trigger] is the player that interacted with the caster
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CHICKEN
Type:CHICKEN
...
@@ -279,8 +286,9 @@ EXAMPLE_MOB:
...
@@ -279,8 +286,9 @@ EXAMPLE_MOB:
```
```
#### ~onSignal:[signal]
#### ~onSignal:[signal]
Executes the skill when the mob receives a signal from the [signal](/Skills/mechanics/signal) mechanic.
Executes the skill when the mob receives a signal from the [signal](/Skills/mechanics/signal) mechanic.
A signal must be alphanumeric.
A signal must be alphanumeric.
> The associated [@trigger] is the entity that sent the signal
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:CHICKEN
Type:CHICKEN
...
@@ -312,7 +320,8 @@ DUMMY_MOB:
...
@@ -312,7 +320,8 @@ DUMMY_MOB:
#### ~onShoot
#### ~onShoot
Executes the skill when the mob shoots a projectile.
Executes the skill when the mob shoots a projectile.
For example, skeletons with bows will shoot arrows; ghasts, blazes, or ender dragon will shoot some type of fireball.
For example, skeletons with bows will shoot arrows; ghasts, blazes, or ender dragon will shoot some type of fireball.
> The associated [@trigger] is the caster
```yml
```yml
EXAMPLE_MOB:
EXAMPLE_MOB:
Type:SKELETON
Type:SKELETON
...
@@ -322,9 +331,22 @@ EXAMPLE_MOB:
...
@@ -322,9 +331,22 @@ EXAMPLE_MOB:
-message{m=I SHOT AN ARROW} @World ~onShoot
-message{m=I SHOT AN ARROW} @World ~onShoot
```
```
#### ~onBowHit
Executes a skill when the mob's projectile hits an entity.
> The associated [@trigger] is the entity that has been hit