Class LapisCoreCancellableEvent

  • All Implemented Interfaces:
    org.bukkit.event.Cancellable

    public class LapisCoreCancellableEvent
    extends LapisCoreEvent
    implements org.bukkit.event.Cancellable
    An utility class to make cancellable events
    • Constructor Detail

      • LapisCoreCancellableEvent

        public LapisCoreCancellableEvent()
    • Method Detail

      • isCancelled

        public boolean isCancelled()
        Check if the event is cancelled
        Specified by:
        isCancelled in interface org.bukkit.event.Cancellable
        Returns:
        Returns true if the event has been cancelled by an event listener
      • setCancelled

        @Deprecated
        public void setCancelled​(boolean cancel)
        Deprecated.
        Please use setCancelled(boolean, String) to provide a reason for why you are cancelling the event
        Specified by:
        setCancelled in interface org.bukkit.event.Cancellable
        Parameters:
        cancel - The boolean value for the cancelled state of the event
      • setCancelled

        public void setCancelled​(boolean cancel,
                                 java.lang.String reason)
        Cancel the event with a reason
        Parameters:
        cancel - True if the event should be cancelled
        reason - The reason to be sent to the player as to why the event was cancelled, Not all plugins implement this
      • getReason

        public java.lang.String getReason()
        Get the reason from setCancelled(boolean, String)
        Returns:
        Returns the String reason as to why the event was cancelled, This will probably be null if the event is not cancelled