Class StateChangeEvent

java.lang.Object
org.bukkit.event.Event
wtf.nucker.kitpvpplus.api.events.StateChangeEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public abstract class StateChangeEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
  • Constructor Details

    • StateChangeEvent

      public StateChangeEvent(org.bukkit.entity.Player player, PlayerState oldState, PlayerState newState)
  • Method Details

    • isCancelled

      public boolean isCancelled()
      See if the event is canceled
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      if the event is canceled
      See Also:
      StateChangeEvent#setCancelled(boolean) to cancel/uncancel the event
    • setCancelled

      public void setCancelled(boolean cancel)
      Cancel/uncancel the event This sets the player's state back to the old state. It will scuff up locations
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancel - weather it should be cancelled or not
    • getHandlers

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

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

      public org.bukkit.entity.Player getPlayer()
      Returns:
      the player whose state is being changed
    • getNewState

      public PlayerState getNewState()
      Returns:
      the new state of the player
    • getOldState

      public PlayerState getOldState()
      Returns:
      the old state of the player
    • setNewState

      public abstract void setNewState(PlayerState state)
      Set a new state
      Parameters:
      state - the new state