Skip to content

3. Events

TreemanKing edited this page May 24, 2024 · 4 revisions

This page shows a list of events and the requirement of each event.

Events

ATTACK

  • This event fires when a player attacks an entity
  • There are certain types types/actions other than the Common Event Types.
    • COMBAT_PLAYER (Combat to player by melee)
    • COMBAT_PLAYER_PROJECTILE (Combat to player by projectile)
    • COMBAT_MOB (Combat to mob by melee)
    • COMBAT_MOB_PROJECTILE (Combat to mob by projectile)
    • If none of these are selected, it will default as any melee/projectile to any entity
Events:
  - ATTACK:
      Type: COMBAT_PLAYER
      Effects:

CONSUME

  • This event fires when a player consumes an item (eating/drinking).
  • There are no additional event types/actions other than the Common Event Types.
Events:
  - CONSUME:
      Effects:

DAMAGED

  • This event fires when a player is damaged
  • There are certain types types/actions other than the Common Event Types.
    • DAMAGE_PLAYER (Damage by player by melee)
    • DAMAGE_PLAYER_PROJECTILE (Damage by player by projectile)
    • DAMAGE_MOB (Damage by mob)
    • DAMAGE_MOB_PROJECTILE (Damage by mob by projectile)
    • If none of these are selected, it will default as any melee/projectile to any entity
Events:
  - DAMAGED:
      Type: DAMAGE_PLAYER
      Effects:

HOOK

  • This event fires when a player casts in/out a fishing rod.
  • There are certain event types/actions other than the Common Event Types.
    • HOOK
Events:
  - HOOK:
      Effect-Target: HOOK
      Effects:

JUMP

  • This event fires when a player jumps.
  • There are no additional event types/actions other than the Common Event Types.
Events:
  - JUMP:
      Effects:

ON_EQUIP

  • This event fires when the armor set is initially equipped. This means the effects will apply when the armor set is equipped.
  • There are no additional event types/actions other than the Common Event Types.
Events:
  - ON_EQUIP:
      Effects:

ON_POTION_EFFECT

  • This event fires when a potion effect is modified on a player
  • There are certain types types/actions other than the Common Event Types.
    • - (Event will only fire if the player activates the certain potion)
Events:
  - ON_POTION_EFFECT:
      Type: 
      - REGENERATION
      - POISON
      Effects:

PLAYER_ELYTRA_BOOST

  • This event fires when a player boosts an elytra with a firework
  • There are no additional event types/actions other than the Common Event Types.
Events:
  - PLAYER_ELYTRA_BOOST:
      Effects:

Common Event Types

Chance:

Chance is a double value in between 0.0 and 1.0.

Example

# Represents the structure of chance (50% chance of firing)
Events:
  - <Event-Name>
      Chance: 0.5 

Conditions:

Important

Conditions relies on PlaceholderAPI to be installed on your server. Without this and it's expansions, this section will not work.

Conditions are a list of strings where each string is a new condition that is required.

Structure

  • The structure requires the placeholder to be at the front and make it equivalent to a certain value. It is of a string type so make sure you include " " in it

Structure Example "%placeholder% == string/number"

Operators

  • The operators for the conditions are: == , <, >, <=, >=

Example

# Represents the structure of conditions
Events:
  - <Event-Name>
      Conditions:
        - "%player_world% == world"
        - "%player_level% > 5"

Cooldown:

Cooldown is an integer represented in seconds which requires a value greater than 0 for it to operate.

Example

# Represents the structure required for cooldown (5 second cooldown in real-time)
Events:
  - <Event-Name>
      Cooldown: 5 # (in seconds)
Clone this wiki locally