Package de.jeff_media.angelchest.events
Class AngelChestOpenEvent
java.lang.Object
org.bukkit.event.Event
de.jeff_media.angelchest.events.AngelChestOpenEvent
- All Implemented Interfaces:
Cancellable
Represents an event related to "opening" an AngelChest by either fast-looting it, opening its GUI or breaking the block itself.
It will NOT get called when the inventory of an AngelChest is opened in preview (read-only) mode.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorDescriptionAngelChestOpenEvent(AngelChest angelChest, Player player, AngelChestOpenEvent.Reason reason)
-
Method Summary
Modifier and TypeMethodDescription@NotNull AngelChest
Returns the AngelChest that is about to be openedstatic @NotNull HandlerList
@NotNull HandlerList
@NotNull Player
Returns the player that is about to open the AngelChest@NotNull AngelChestOpenEvent.Reason
Gets the Reason for opening the AngelChestboolean
Gets whether the event is cancelled.void
setCancelled(boolean cancelled)
Sets whether the event is cancelled.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
AngelChestOpenEvent
public AngelChestOpenEvent(AngelChest angelChest, Player player, AngelChestOpenEvent.Reason reason)
-
-
Method Details
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-
getAngelChest
Returns the AngelChest that is about to be opened -
getPlayer
Returns the player that is about to open the AngelChest -
isCancelled
public boolean isCancelled()Gets whether the event is cancelled. If the event is cancelled, the AngelChest will not be opened, fast-looted or broken.- Specified by:
isCancelled
in interfaceCancellable
-
setCancelled
public void setCancelled(boolean cancelled)Sets whether the event is cancelled. If the event is cancelled, the AngelChest will not be opened, fast-looted or broken.- Specified by:
setCancelled
in interfaceCancellable
-
getReason
Gets the Reason for opening the AngelChest
-