Skip to content

๐Ÿ’ฅ Triggers โ€‹

When using MMOItems or MMOCore, you will need to specify when a specific skill should be executed: when damaging an entity, when being damaged, when crouching etc. This is done using triggers. MMOItems used to call them casting modes.

Available Triggers โ€‹

These are the trigger types that you can use in MMO plugins to define when some skill is supposed to run. Some triggers are only available if MMOCore is installed, like combat- or level-related triggers.

Skill TriggerDescriptionTrigger TargetTrigger Target Block
Combat Triggers
KILL_ENTITYActivates the skill when a player kills an entityThe killed entity-
KILL_PLAYERActivates the skill when a player kills an playerThe killed player-
ATTACKActivates the skill when the player attacks somethingThe entity the player attacked-
DAMAGEDActivates the skill when the player takes damage--
DAMAGED_BY_ENTITYActivates the skill when the player takes damage from an entityThe entity that damaged the player-
DEATHActivates the skill when the player dies--
Projectile Triggers
SHOOT_TRIDENTWhen the player shoots a tridentThe projectile-
TRIDENT_TICKActivates every tick when a trident is still midairThe projectile-
TRIDENT_LANDWhen a trident lands on the groundThe projectile-
TRIDENT_HITWhen a thrown trident hits an entityThe hit entity-
SHOOT_BOWWhen the player fires an arrowThe projectile-
ARROW_TICKActivates every tick when an arrow is still midairThe projectile-
ARROW_LANDWhen an arrow lands on the groundThe projectile-
ARROW_HITWhen a fired arrow hits an entityThe hit entity-
Click Triggers
RIGHT_CLICKOn player right click--
LEFT_CLICKOn player left click--
SHIFT_RIGHT_CLICKOn player right click while sneaking--
SHIFT_LEFT_CLICKOn player left click while sneaking--
Block Triggers-
BREAK_BLOCKActivates the skill when a player break block-Location of mined block
PLACE_BLOCKActivates the skill when a player place block-Located of placed block
MMOCore Triggers
ENTER_COMBATActivates the skill when a player enter combat--
QUIT_COMBATActivates the skill when a player quit combat--
Item Triggers
DROP_ITEMActivates the skill when a player press QThe dropped item-
SHIFT_DROP_ITEMActivates the skill when a player press Shift + QThe dropped item-
SWAP_ITEMSActivates the skill when a player press F--
SHIFT_SWAP_ITEMSActivates the skill when a player press Shift + F--
EQUIP_ARMORActivates the skill when a player enquip armorThe player-
UNEQUIP_ARMORActivates the skill when a player unenquip armorThe player-
Miscellaneous
LOGINActivates the skill when a player logins--
SNEAKActivates the skill when a player sneaks--
TELEPORTActivates the skill when a player teleport-The target teleport location
TIMERCasts the skill every X ticks--

When a skill/script is triggered โ€‹

Some trigger types pass on special properties to the script they trigger. For instance, when using the ATTACK trigger type, the <target> variable can be used to access the entity being damaged. <attack.damage> returns the attack damage.

Trigger types featuring entities/projectiles like ATTACK, DAMAGED, DAMAGED_BY_ENTITY, KILL_ENTITY, SHOOT_TRIDENT, ARROW_TICK etc. allow the user to use the <target> internal variable to access the target projectile entity. These triggers also unlock the target entity targeter as well as the target_location location targeter.

Trigger types featuring world locations like TRIDENT_LAND or ARROW_HIT unlock the target_location location targeter as well as the <target_location> internal variable for example.

Some triggers like TIMER or RIGHT_CLICK do not unlock any additional internal variable.

ATTACK is the only trigger type which unlocks the <attack> internal variable as well as special mechanics (multiply_damage) or conditions (has_damage_type).

Powered by VitePress