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
Called when a player gains XP for killing or damaging an entity. By default, this
is either the Fighting or Archery skill.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionEntityXpGainEvent
(org.bukkit.entity.Player player, SkillsUser user, Skill skill, XpSource source, double amount, org.bukkit.entity.LivingEntity attacked, org.bukkit.entity.Entity damager, @Nullable org.bukkit.event.entity.EntityEvent originalEvent) -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.entity.LivingEntity
Gets the entity that was killed or damaged by the player.org.bukkit.entity.Entity
Gets the entity that actual dealt damage to the attacked entity.@Nullable org.bukkit.event.entity.EntityEvent
Gets the original event that triggered the XP gain.Methods inherited from class dev.aurelium.auraskills.api.event.skill.XpGainEvent
getAmount, getHandlerList, getHandlers, getPlayer, getSkill, getSource, getUser, isCancelled, setAmount, setCancelled
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
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
-