Class OllivandersBookLearningSpellEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
net.pottercraft.ollivanders2.book.events.OllivandersBookLearningSpellEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class OllivandersBookLearningSpellEvent extends org.bukkit.event.player.PlayerEvent implements org.bukkit.event.Cancellable
The event that is fired every time a spell is learned/leveled up from book learning
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Field Summary

    Fields inherited from class org.bukkit.event.player.PlayerEvent

    player
  • Constructor Summary

    Constructors
    Constructor
    Description
    OllivandersBookLearningSpellEvent(@NotNull org.bukkit.entity.Player player, @NotNull O2SpellType spell)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.event.HandlerList
    Get the handlers for this Event
    @NotNull org.bukkit.event.HandlerList
    Get the handlers for this Event
    @NotNull O2SpellType
    get the spell type that was learned
    boolean
    Is this event canceled?
    void
    setCancelled(boolean cancel)
    Set whether this event is canceled or not

    Methods inherited from class org.bukkit.event.player.PlayerEvent

    getPlayer

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OllivandersBookLearningSpellEvent

      public OllivandersBookLearningSpellEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull O2SpellType spell)
      Constructor
      Parameters:
      player - the player who found their wand
      spell - the spell type that was learned
  • Method Details

    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Get the handlers for this Event
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      the event handlers
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
      Get the handlers for this Event
      Returns:
      the event handlers
    • getSpellType

      @NotNull public @NotNull O2SpellType getSpellType()
      get the spell type that was learned
      Returns:
      the spell type
    • isCancelled

      public boolean isCancelled()
      Is this event canceled?
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      true if canceled, false otherwise
    • setCancelled

      public void setCancelled(boolean cancel)
      Set whether this event is canceled or not
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancel - true if event should be canceled, false otherwise