Class ToggleEvent

java.lang.Object
org.bukkit.event.Event
simplexity.scythe.events.ToggleEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class ToggleEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
  • Nested Class Summary

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

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

    Constructors
    Constructor
    Description
    ToggleEvent(org.bukkit.entity.Player player, org.bukkit.NamespacedKey namespacedKey)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    Gets the current toggle state of the player
    Returns a default of 0b (Enabled) if there was no information on the player
    static org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
     
    org.bukkit.entity.Player
    Gets the player whose settings were toggled
    boolean
    Gets if the event is cancelled
    void
    setCancelled(boolean cancel)
    Sets if the event should be cancelled
    void
    Sets the toggle to be disabled in the player's PDC
    Sets value to 1b
    void
    Sets the toggle to be enabled in the player's PDC
    Sets value to 0b
    Calls sendPlayerFeedback() with the ENABLED_MESSAGE_FORMAT message

    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

    • ToggleEvent

      public ToggleEvent(org.bukkit.entity.Player player, org.bukkit.NamespacedKey namespacedKey)
  • Method Details

    • getCurrentToggleState

      public byte getCurrentToggleState()
      Gets the current toggle state of the player
      Returns a default of 0b (Enabled) if there was no information on the player
      Returns:
      byte
    • setDisabled

      public void setDisabled()
      Sets the toggle to be disabled in the player's PDC
      Sets value to 1b
    • setEnabled

      public void setEnabled()
      Sets the toggle to be enabled in the player's PDC
      Sets value to 0b
      Calls sendPlayerFeedback() with the ENABLED_MESSAGE_FORMAT message
    • 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()
    • isCancelled

      public boolean isCancelled()
      Gets if the event is cancelled
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      boolean
    • setCancelled

      public void setCancelled(boolean cancel)
      Sets if the event should be cancelled
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancel - true if you wish to cancel this event
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Gets the player whose settings were toggled
      Returns:
      Player