Class EntityXpGainEvent

java.lang.Object
org.bukkit.event.Event
dev.aurelium.auraskills.api.event.skill.XpGainEvent
dev.aurelium.auraskills.api.event.skill.EntityXpGainEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class EntityXpGainEvent extends XpGainEvent
Called when a player gains XP for killing or damaging an entity. By default, this is either the Fighting or Archery skill.
  • Constructor Details

    • EntityXpGainEvent

      public EntityXpGainEvent(org.bukkit.entity.Player player, SkillsUser user, Skill skill, XpSource source, double amount, org.bukkit.entity.LivingEntity attacked, org.bukkit.entity.Entity damager, @Nullable @Nullable org.bukkit.event.entity.EntityEvent originalEvent)
  • Method Details

    • getAttacked

      public org.bukkit.entity.LivingEntity getAttacked()
      Gets the entity that was killed or damaged by the player.
      Returns:
      the attacked entity
    • getDamager

      public org.bukkit.entity.Entity getDamager()
      Gets the entity that actual dealt damage to the attacked entity. This could be the player or a projectile.
      Returns:
      the entity damager
    • getOriginalEvent

      @Nullable public @Nullable org.bukkit.event.entity.EntityEvent getOriginalEvent()
      Gets the original event that triggered the XP gain. Either EntityDeathEvent or EntityDamageByEntity event. Could be null if caused by plugin mechanics like Bleed.
      Returns:
      the original event object, or null if no Bukkit event is linked to the XP gain