Interface Event
- All Known Implementing Classes:
BaseEvent,BeeStingEvent,CollisionEvent,EntityDamageEntityEvent,EntityDamageEvent,EntityDeathEvent,EntityDespawnEvent,EntityEvent,EntityMoveEvent,EntitySpawnEvent,PartCollisionEvent,TileCollisionEvent
public interface Event
Represents a cancellable event in the game system.
Events are objects that can be posted to an EventBus and handled
by EventListeners. Certain events can be cancelled to prevent
default behavior or propagation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels this event.booleanChecks whether this event has been canceled.voidsetCanceled(boolean canceled) Sets the canceled state of this event.
-
Method Details
-
cancel
void cancel()Cancels this event.Calling this method sets the event's canceled state to
true.- See Also:
-
isCanceled
boolean isCanceled()Checks whether this event has been canceled.- Returns:
trueif the event is canceled,falseotherwise- See Also:
-
setCanceled
void setCanceled(boolean canceled) Sets the canceled state of this event.- Parameters:
canceled-trueto cancel the event,falseto uncancel- See Also:
-