Class CustomBlockDataEvent

java.lang.Object
org.bukkit.event.Event
com.jeff_media.customblockdata.events.CustomBlockDataEvent
All Implemented Interfaces:
Cancellable
Direct Known Subclasses:
CustomBlockDataMoveEvent, CustomBlockDataRemoveEvent

public class CustomBlockDataEvent extends Event implements 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.
  • Constructor Details

    • CustomBlockDataEvent

      protected CustomBlockDataEvent(@NotNull Plugin plugin, @NotNull Block block, @NotNull Event bukkitEvent)
  • Method Details

    • getBlock

      @NotNull public Block getBlock()
      Gets the block involved in this event.
    • getBukkitEvent

      @NotNull public 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

      @NotNull public CustomBlockData getCustomBlockData()
      Gets the CustomBlockData involved in this event.
    • isCancelled

      public boolean isCancelled()
      Gets the cancellation status of this event.
      Specified by:
      isCancelled in interface 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:
      setCancelled in interface Cancellable
    • getReason

      @NotNull public CustomBlockDataEvent.Reason getReason()
      Gets the reason for this change of CustomBlockData
    • getHandlerList

      @NotNull public static HandlerList getHandlerList()
    • getHandlers

      @NotNull public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event