Class DamageXpGainEvent
java.lang.Object
org.bukkit.event.Event
dev.aurelium.auraskills.api.event.skill.XpGainEvent
dev.aurelium.auraskills.api.event.skill.DamageXpGainEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
Called when a player gains XP for being damaged by an entity. By default, this is the Defense skill.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionDamageXpGainEvent
(org.bukkit.entity.Player player, SkillsUser user, Skill skill, @Nullable XpSource source, double amount, DamageXpSource.DamageCause cause, @Nullable org.bukkit.entity.Entity damager, org.bukkit.event.entity.EntityEvent originalEvent) -
Method Summary
Modifier and TypeMethodDescriptiongetCause()
Gets the cause of the damage@Nullable org.bukkit.entity.Entity
Get the entity that damaged the player if the damage was caused by an entityorg.bukkit.event.entity.EntityEvent
Gets the original event for the player being damagedMethods 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
-
DamageXpGainEvent
public DamageXpGainEvent(org.bukkit.entity.Player player, SkillsUser user, Skill skill, @Nullable @Nullable XpSource source, double amount, DamageXpSource.DamageCause cause, @Nullable @Nullable org.bukkit.entity.Entity damager, org.bukkit.event.entity.EntityEvent originalEvent)
-
-
Method Details
-
getCause
Gets the cause of the damage- Returns:
- the damage cause
-
getDamager
@Nullable public @Nullable org.bukkit.entity.Entity getDamager()Get the entity that damaged the player if the damage was caused by an entity- Returns:
- the damager, or null if non-entity damage
-
getOriginalEvent
public org.bukkit.event.entity.EntityEvent getOriginalEvent()Gets the original event for the player being damaged- Returns:
- the original event
-