Class CustomBlockDataEvent
java.lang.Object
org.bukkit.event.Event
com.jeff_media.customblockdata.events.CustomBlockDataEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
- Direct Known Subclasses:
CustomBlockDataMoveEvent,CustomBlockDataRemoveEvent
public class CustomBlockDataEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Represents an event that removes, changes or moves CustomBlockData due to regular Bukkit Events.
This event gets called during the underlying Bukkit Event's MONITOR listening phase. If the Bukkit Event
was already cancelled, this event will not be called.
If this event is cancelled, CustomBlockData will not be removed, changed or moved.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the reason for a change of CustomBlockDataNested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCustomBlockDataEvent(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull org.bukkit.block.Block block, @NotNull org.bukkit.event.Event bukkitEvent) -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.block.BlockgetBlock()Gets the block involved in this event.@NotNull org.bukkit.event.EventGets the underlying Bukkit Event that has caused this event to be called.@NotNull CustomBlockDataGets the CustomBlockData involved in this event.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerList@NotNull CustomBlockDataEvent.ReasonGets the reason for this change of CustomBlockDatabooleanGets the cancellation status of this event.voidsetCancelled(boolean cancel) Sets the cancellation status of this event.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
CustomBlockDataEvent
protected CustomBlockDataEvent(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull org.bukkit.block.Block block, @NotNull @NotNull org.bukkit.event.Event bukkitEvent)
-
-
Method Details
-
getBlock
@NotNull public @NotNull org.bukkit.block.Block getBlock()Gets the block involved in this event. -
getBukkitEvent
@NotNull public @NotNull org.bukkit.event.Event getBukkitEvent()Gets the underlying Bukkit Event that has caused this event to be called. The Bukkit Event is currently listened on in MONITOR priority. -
getCustomBlockData
Gets the CustomBlockData involved in this event. -
isCancelled
public boolean isCancelled()Gets the cancellation status of this event.- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) Sets the cancellation status of this event. If the event is cancelled, the CustomBlockData will not be removed, changed or moved.- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getReason
Gets the reason for this change of CustomBlockData -
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList() -
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-