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

    Constructors
    Constructor
    Description
    XpGainEvent(org.bukkit.entity.Player player, SkillsUser user, Skill skill, @Nullable XpSource source, double amount)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    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.
    Gets the skill the XP was gained in.
    @Nullable XpSource
    Gets the XP source that triggered XP gain.
    Gets the SkillsUser 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public SkillsUser getUser()
      Gets the SkillsUser of the player who gained XP.
      Returns:
      the user
    • getSkill

      public Skill getSkill()
      Gets the skill the XP was gained in.
      Returns:
      the skill
    • getSource

      @Nullable public @Nullable XpSource 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 interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()