Interface Cancellable

All Known Implementing Classes:
BlockBreakEvent, BlockPlaceEvent, EntityDamageEvent, GameRuleChangeEvent, PlayerAttackEntityEvent, PlayerChatEvent, PlayerLoginAttemptEvent, PlayerMoveEvent, PlayerOpenEnderChestEvent, PlayerSignedChatEvent

public interface Cancellable
An Event whose outcome listeners can veto.

Listeners keep being called once an event is cancelled, so a later listener may restore it; the server only checks the flag after every listener has run.

Since:
0.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the action this event describes will not happen.
    void
    setCancelled(boolean cancelled)
    Prevents or re-allows the action this event describes.
  • Method Details

    • isCancelled

      boolean isCancelled()
      Returns true if the action this event describes will not happen.
      Returns:
      true if the action this event describes will not happen
      Since:
      0.1.0
    • setCancelled

      void setCancelled(boolean cancelled)
      Prevents or re-allows the action this event describes.
      Parameters:
      cancelled - true to prevent it
      Since:
      0.1.0