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 TypeMethodDescriptionbooleanReturnstrueif the action this event describes will not happen.voidsetCancelled(boolean cancelled) Prevents or re-allows the action this event describes.
-
Method Details
-
isCancelled
boolean isCancelled()Returnstrueif the action this event describes will not happen.- Returns:
trueif 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-trueto prevent it- Since:
- 0.1.0
-