Skip to main content

Enchantment Events

Type: EnchantmentEvent (enum) Events represent the game actions that trigger enchantment mechanics. Each event corresponds to a Bukkit event that the extension listens for.

Available Events

EventTriggered WhenBukkit Event
PLAYER_ATTACKPlayer hits an entityEntityDamageByEntityEvent
PLAYER_DEFENDPlayer takes damageEntityDamageByEntityEvent
BLOCK_BREAKPlayer breaks a blockBlockBreakEvent
BOW_SHOOTPlayer shoots a bow or crossbowEntityShootBowEvent
PROJECTILE_HITA shot projectile hits an entityProjectileHitEvent
ITEM_CONSUMEPlayer eats or drinks an itemPlayerItemConsumeEvent
PLAYER_DEATHPlayer diesPlayerDeathEvent
PLAYER_INTERACTPlayer right/left clicksPlayerInteractEvent
ARMOR_EQUIPPlayer equips or unequips armorInternal listener
ITEM_DAMAGEAn item takes durability damageInternal listener
FALL_DAMAGEPlayer takes fall damageEntityDamageEvent
ENVIRONMENTAL_DAMAGENon-entity damage (fire, lava, kinetic)EntityDamageEvent
PLAYER_MOVEPlayer moves (throttled)PlayerMoveEvent

Usage

Events are used within EnchantmentMechanic to determine when mechanics should execute:
{
  "mechanics": [
    {
      "event": "PLAYER_ATTACK",
      "criteria": [...],
      "actions": ["combat:lifesteal_action"],
      "runOnLevel": 1,
      "chance": 100
    }
  ]
}