Interface CancellableEvent

All Superinterfaces:
ModelEvent
All Known Implementing Classes:
DismountModelEvent, HitBoxDamagedEvent, HitBoxInteractAtEvent, HitBoxInteractEvent, ModelSpawnAtPlayerEvent, MountModelEvent, PlayerHideTrackerEvent, PlayerShowTrackerEvent, RemovePlayerSkinEvent

public interface CancellableEvent extends ModelEvent
Represents an event that can be canceled.

Cancelling an event typically prevents the associated action from completing.

Since:
2.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Dispatches this event to the global event bus.
    boolean
    Checks if the event has been canceled.
    void
    setCancelled(boolean cancel)
    Sets the cancellation state of the event.
  • Method Details

    • isCancelled

      boolean isCancelled()
      Checks if the event has been canceled.
      Returns:
      true if canceled, false otherwise
      Since:
      2.0.0
    • setCancelled

      void setCancelled(boolean cancel)
      Sets the cancellation state of the event.
      Parameters:
      cancel - true to cancel the event, false to allow it
      Since:
      2.0.0
    • call

      default boolean call()
      Description copied from interface: ModelEvent
      Dispatches this event to the global event bus.
      Specified by:
      call in interface ModelEvent
      Returns:
      the event is successfully triggered