Class XpGainEvent
java.lang.Object
org.bukkit.event.Event
dev.aurelium.auraskills.api.event.skill.XpGainEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
- Direct Known Subclasses:
DamageXpGainEvent
,EntityXpGainEvent
public class XpGainEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Called when a player gains XP in a skill.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionXpGainEvent
(org.bukkit.entity.Player player, SkillsUser user, Skill skill, @Nullable XpSource source, double amount) -
Method Summary
Modifier and TypeMethodDescriptiondouble
Gets the amount of XP about to be gained, after applying multipliers.static org.bukkit.event.HandlerList
@NotNull org.bukkit.event.HandlerList
org.bukkit.entity.Player
Gets the player tha gained the XP.getSkill()
Gets the skill the XP was gained in.@Nullable XpSource
Gets the XP source that triggered XP gain.getUser()
Gets theSkillsUser
of the player who gained XP.boolean
void
setAmount
(double amount) Sets the amount of XP to be gained.void
setCancelled
(boolean cancelled) Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
XpGainEvent
public XpGainEvent(org.bukkit.entity.Player player, SkillsUser user, Skill skill, @Nullable @Nullable XpSource source, double amount)
-
-
Method Details
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the player tha gained the XP.- Returns:
- the player
-
getUser
Gets theSkillsUser
of the player who gained XP.- Returns:
- the user
-
getSkill
Gets the skill the XP was gained in.- Returns:
- the skill
-
getSource
Gets the XP source that triggered XP gain.- Returns:
- the source, or null if it is not from a defined source
-
getAmount
public double getAmount()Gets the amount of XP about to be gained, after applying multipliers.- Returns:
- the amount of XP gained
-
setAmount
public void setAmount(double amount) Sets the amount of XP to be gained.- Parameters:
amount
- the amount to be gained
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-