Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicMobs MythicMobs
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 146
    • Issues 146
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicMobsMythicMobs
  • Wiki
    • Skills
  • Triggers

Triggers · Changes

Page history
Reformat everything? authored Dec 31, 2022 by Phillip's avatar Phillip
Hide whitespace changes
Inline Side-by-side
Showing with 267 additions and 174 deletions
+267 -174
  • Skills/Triggers.md Skills/Triggers.md +267 -174
  • No files found.
Skills/Triggers.md
View page @ c5556006
Skill Triggers
==============
Triggers are used to determine how a skill is triggered from within the Triggers are used to determine how a skill is triggered from within the
mobs skill configuration section. mobs skill configuration section.
...@@ -8,6 +5,7 @@ mobs skill configuration section. ...@@ -8,6 +5,7 @@ mobs skill configuration section.
IN THEM.**</u> Triggers can only be used *to activate* the meta-skill IN THEM.**</u> Triggers can only be used *to activate* the meta-skill
itself. itself.
<!--
**Table of all available triggers:** **Table of all available triggers:**
| Trigger | When it fires... | | Trigger | When it fires... |
...@@ -37,27 +35,29 @@ itself. ...@@ -37,27 +35,29 @@ itself.
| onTame | When the mob gets tamed | | onTame | When the mob gets tamed |
| onBreed | When the mob breeds with another mob. | | onBreed | When the mob breeds with another mob. |
| onTrade | When the Villager completes a trade. Requires Paper | | onTrade | When the Villager completes a trade. Requires Paper |
-->
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 tilda (~) 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.
```yml
SkeletalWizard_Fire: SkeletalWizard_Fire:
Type: WITHER_SKELETON Type: WITHER_SKELETON
Display: '&Skeletal Fire Wizard' Display: '&Skeletal Fire Wizard'
Health: 50 Health: 50
Damage: 0.5 Damage: 0.5
Skills: Skills:
- ignite{ticks=100} @target ~onAttack - ignite{ticks=100} @target ~onAttack
- skill{s=FireShield} @trigger ~onDamaged 0.1 - skill{s=FireShield} @trigger ~onDamaged 0.1
- skill{s=AOEFire} ~onTimer:300 - skill{s=AOEFire} ~onTimer:300
```
In this example the mob will also set its target on fire when 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 [1]. will use the "AOEFire" skill every 300 ticks, or every 15 seconds.
Not using Triggers... Not using Triggers...
--------------------- ---------------------
...@@ -67,172 +67,265 @@ skill should go off. It is **highly** recommended that you trigger all ...@@ -67,172 +67,265 @@ 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
methods. methods.
If a skill does not have a trigger, it will default to the "~onCombat" If a skill does not have a trigger, it will default to the `~onCombat`
trigger (shown further below) which will execute when these four basic trigger which will execute when these events occur:
things occur: - When the mob deals or takes damage
- When the mob spawns
- The mob takes damage - When the mob dies
- The mob deals damage
- The mob spawns
- The mob dies
<!-- --> <!-- -->
```yml
SkeletalWarrior: SkeletalWarrior:
Mobtype: skeleton Mobtype: skeleton
Display: '&9A Skeletal Warrior' Display: '<blue>A Skeletal Warrior</blue>'
Health: 100 Skills:
Damage: 2 - skill{s=Bash} =10%-90%
Drops: ```
- DropTable
Skills:
- skill{s=Bash} =10%-90%
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
above, and listed in the targeters section. The @trigger will target the shown above, and listed in the [targeters](/Skills/Targeters) section. The `@trigger` will target the
"cause" of the skill being set off, i.e. if a player damages a mob and entity that "caused" the skill to trigger, i.e. when a player damages a mob and
that mob uses an onDamage-triggered skill, it will target that player. 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 has 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.
Detailed Descriptions & Examples All Available Triggers
-------------------------------- ----------------------
#### ~onSpawn
**~onSpawn** Executes the skill when the mob spawns. This does not have `@trigger`.
```yml
- Trigger the skill to execute when the mob spawns. EXAMPLE_MOB:
- This will only occur once. Type: CHICKEN
- Can be used along with the chance parameters to make the chance to Skills:
execute less than 100% # sends a message to all the players in the world
- **- skill{s=DamageImmunity} ~onSpawn 0.50** (The mob has a 50% # when the mob spawns
chance to use a DamageImmunity skill when it spawns) - message{m=SPAWN} @World ~onSpawn
```
**~onDeath**
#### ~onDeath
- Trigger the skill to execute when the mob dies. Executes the skill when the mob dies. The entity that killed the mob is the `@trigger`.
- This will only occur once. ```yml
- Can be used along with the chance parameters to make the chance to EXAMPLE_MOB:
execute less than 100% Type: CHICKEN
- **- skill{s=SpawnSpiderlings} ~onDeath 1** (The mob has a 100% Skills:
chance to use a SpawnSpiderlings spell when it dies) # sends a message to all the players in the world
# when the mob dies
**~onAttack** - message{m=DEATH} @World ~onDeath
```
- Trigger the skill to execute when the mob attacks.
- This will occur anytime the mob attacks something. #### ~onAttack
- Can be used along with the health and chance parameters to further Executes the skill when the mob attacks an entity.
define when this occurs. The `@trigger` is the entity that took damage from the attack.
- **- skill{s=Bash} ~onAttack &lt;50% 0.1** (The mob has a 10% ```yml
chance to use the Bash skill when it attacks and has less than 50% EXAMPLE_MOB:
health) Type: CHICKEN
Damage: 1
**~onDamaged** Skills:
# sends a message to all the players in the world
- Trigger the skill to execute when the mob takes damage. # when the mob attacks an entity
- This will occur anytime the mob takes damage. - message{m=ATTACK} @World ~onAttack
- Can be used along with the health and chance parameters to further ```
define when this occurs.
- **- skill{s=FlameShield} ~onDamaged 1** (The mob has a 100% chance #### ~onDamaged
to use the FlameShield skill when it takes damage) Executes the skill when the mob takes damage. The `@trigger` is the attacker.
```yml
**~onExplode** EXAMPLE_MOB:
Type: CHICKEN
- Trigger the skill to execute when the mob explodes. Skills:
- This will generally occur only once unless you have the # sends a message to all the players in the world
PreventSuicide option set. Generally only works with creepers, since # when the mob takes damage
other mobs tend to not explode... - message{m=DAMAGED} @World ~onDamaged
- Can be used along with the chance parameters to make the chance to ```
execute less than 100%
- **- skill{s=SpawnCreeper} ~onExplode 0.25** (The mob has a 25% #### ~onExplode
chance to use the SpawnCreeper skill when it explodes) Executes the skill when the mob explodes.
Generally, this trigger only works with creepers and TNTs since other mobs tend to not explode...
**~onTeleport** ```yml
EXAMPLE_MOB:
- Trigger the skill to execute when the mob teleports. Type: CREEPER
- Generally only used for Endermen or mobs that have skills that Skills:
allow them to teleport. # sends a message to all the players in the world
- Can be used along with the health and chance parameters to further # when the mob explodes
define when this occurs. - message{m=EXPLODE} @World ~onExplode
- **- skill{s=GustOfWind} ~onTeleport &lt;50% 1** (The mob has a ```
100% chance to use a GustOfWind spell when it teleports if it has
less than 50% health) #### ~onTeleport
Executes the skill when the mob teleports.
**~onTimer:&lt;ticks&gt;** ```yml
EXAMPLE_MOB:
- Trigger the skill to execute based on a timer. Type: ENDERMAN
- The timer is in ticks so 20 ticks equates to 1 second. Skills:
- Care must be taken when using the Timer trigger as skills that are # sends a message to all the players in the world
not properly designed can potentially lead to server or client side # when the mob teleports
performance issues. Skills with particularly low timers that call - message{m=TELEPORT} @World ~onTeleport
complex syntax can cause server side performance issues, while large ```
count particle effects and other graphic intensive things can lead
to potential client side performance issues. #### ~onTimer:[tick(s)]
- **- skill{s=SingleTargetFire} ~onTimer:200** (The mob will use the Executes the skill every *n<sup>th</sup>* ticks. Ticks can't be zero and 20 ticks is equal to 1 second.
SingleTargetFire skill every 10 seconds) **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**
**~onPlayerKill** ```yml
EXAMPLE_MOB:
- Trigger the skill to execute when the mob kills a player character. Type: CHICKEN
- Can be used along with the health and chance parameters to further Skills:
define when this occurs. # sends a message to all the players in the world every 0.05 seconds
- **- skill{s=BossRegen} ~onPlayerKill &gt;0 1** (The mob has a 100% - message{m=TIMER every tick (0.05 seconds)} @World ~onTimer:1
chance to use the BossRegen spell when it kills a player) # sends a message to all the players in the world every 2 seconds
- message{m=TIMER every 40 ticks (2 seconds)} @World ~onTimer:40
**~onEnterCombat** ```
- Trigger the skill to execute when the mob enters combat. #### ~onPlayerKill
- This trigger will only work when ThreatTables are enabled. Executes the skill when the mob kills a player.
- **- skill{s=BuffSelf} ~onEnterCombat &gt;0 1** (The mob has a 100% ```yml
chance to use the BuffSelf skill when it enters combat with a player EXAMPLE_MOB:
or mob) Type: CHICKEN
Skills:
**~onDropCombat** # sends a message to all the players in the world
# when the mob kills a player
- Trigger the skill to execute when the mob drops combat. - message{m=PLAYER KILLED} @World ~onPlayerKill
- This trigger will only work when ThreatTables are enabled. ```
- **- skill{s=BossRegen} ~onDropCombat &gt;0 1** (The mob has a 100%
chance to use the BossRegen skill when it drops combat with a player #### ~onEnterCombat
or mob) Executes the skill when the mob enters combat. **REQUIRES [ThreatTables](/Mobs/ThreatTables) to be enabled**
```yml
**~onChangeTarget** EXAMPLE_MOB:
Type: CHICKEN
- Trigger the skill to execute when the mob changes target. Modules:
- This trigger will only work when ThreatTables are enabled. ThreatTable: true
- **- skill{s=Charge} ~onChangeTarget &gt;0 1** (The mob has a 100% Skills:
chance to use the Charge skill when it changes targets) # sends a message to all the players in the world
# when the mob enters combat
**~onInteract** - message{m=ENTERED COMBAT} @World ~onEnterCombat
```
- Trigger the skill to execute when the player interacts with them
(right-clicks on them). #### ~onDropCombat
- **- skill{s=QuestDialogue} ~onInteract &gt;0 1** (The mob has a Executes the skill when the mob drops combat. **REQUIRES [ThreatTables](/Mobs/ThreatTables) to be enabled**
100% chance to use the QuestDialogue skill when the player interacts ```yml
or right-click on it) EXAMPLE_MOB:
Type: CHICKEN
**~onSignal** or **~onSignal:[signal]** Modules:
ThreatTable: true
- Trigger the skill to execute when the mob receives a specific signal from the Signal mechanic. Skills:
- Useful for skills that require communication between mobs or from a # sends a message to all the players in the world
player to a mob [2]. # when the mob enters combat
- See - message{m=DROPPED COMBAT} @World ~onDropCombat
[signal-skill](/skills/mechanics/signal) ```
page.
#### ~onChangeTarget
**~onShoot** Executes the skill when the mob changes target. **REQUIRES [ThreatTables] to be enabled**
```yml
- Trigger the skill to execute when the mob fires a projectile EXAMPLE_MOB:
(Ghast/Blaze Fireballs). Type: CHICKEN
- **- skill{s=ExplodeParticles} ~onShoot &gt;0 1** (The mob has a Modules:
100% chance to use the ExplodeParticles skill when it fires a ThreatTable: true
projectile) Skills:
# sends a message to all the players in the world
[1] 20 ticks = 1 second # when the mob's target changes
- message{m=Target Changed} @World ~onChangeTarget
[2] players can communicate signals to mobs by using the ```
mythicmobs-command /mm signal &lt;uuid&gt; &lt;signal&gt;
\ No newline at end of file #### ~onInteract
Executes the skill when a player interacts with, or *right-clicks*, the mob.
```yml
EXAMPLE_MOB:
Type: CHICKEN
Skills:
# sends a message to all the players in the world
# when a player right-clicks the mob
- message{m=INTERACTED} @World ~onInteract
```
#### ~onSignal:[signal]
Executes the skill when the mob receives a signal from the [signal](/Skills/mechanics/signal) mechanic.
A signal must be alphanumeric.
```yml
EXAMPLE_MOB:
Type: CHICKEN
Skills:
# sends a signal to all mythicmob entity in a radius of 64 blocks
# when a player right-clicks the mob
- signal{s=MOO_FOR_ME} @EIR{r=64} ~onInteract
```
```yml
DUMMY_MOB:
Type: COW
Skills:
# sends a message to all the players in the world
# when the mob receives a "MOO_FOR_ME" signal
- message{m=MOO} @World ~onSignal:MOO_FOR_ME
```
#### ~onShoot
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.
```yml
EXAMPLE_MOB:
Type: SKELETON
Skills:
# sends a message to all the players in the world
# when the skeleton shoots from a bow
- message{m=I SHOT AN ARROW} @World ~onShoot
```
#### ~onBreed
Executes the skill when the mob breeds with another mob.
This trigger has `@Father` and `@Mother` targeters.
```yml
EXAMPLE_MOB:
Type: CHICKEN
Skills:
# sends a message to all the players in the world
# when the mob breeds
- message{m=LET'S GET THIS BREAD} @World ~onBreed
```
#### ~onTame
Executes the skill when the player tames the mob.
```yml
EXAMPLE_MOB:
Type: WOLF
Skills:
# sends a message to all the players in the world
# when a player tames the mob
- message{m=I GOT TAMED} @World ~onTame
```
#### ~onCreeperCharge
Executes the skill when the mob, must be a creeper, is charged.
```yml
EXAMPLE_MOB:
Type: CREEPER
Skills:
# sends a message to all the players in the world
# when the mob gets charge
- message{m=CHARGED} @World ~onCreeperCharge
```
#### ~onPrime
Executes the skill when the mob, must be a creeper, is primed
```yml
EXAMPLE_MOB:
Type: CREEPER
Skills:
# sends a message to all the players in the world
# when the mob is primed
- message{m=OOO I'M GONNA EXPLODE} @World ~onChangeTarget
```
#### ~onTrade
Executes the skill when the villager trades with a player.
```yml
EXAMPLE_MOB:
Type: VILLAGER
Skills:
# sends a message to all the players in the world
# when the mob's target changes
- message{m=TRADED} @World ~onTrade
```
Clone repository
Home
Changelogs
Premium Features
Commands and Permissions
FAQ / Common Issues
Mythic Add-ons
Compatible Plugins
API Information
Packs
Mobs
  • Mob Options
  • Mob Levels
  • Mob Factions
  • Power Scaling
  • Damage Modifiers
  • Equipment
  • BossBar
  • Custom AI
  • Custom Kill Messages
  • Threat Tables
  • Immunity Tables
  • Extra: Disguises
  • Extra: ModelEngine
Skills
  • Mechanics
  • Effects
  • Targeters
    • Filters
  • Triggers
  • Conditions
    • In-line conditions
  • Placeholders
  • Variables
  • Math
Items
  • Options
  • Attributes
  • Enchantments
  • Potions
  • Banner Layers
  • Firework
Drops & DropTables
  • Drop Types
Spawning
  • Spawners
  • Random Spawns
Examples