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 Classes
    Modifier and Type
    Class
    Description
    static enum 
    Represents the reason for a change of CustomBlockData

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    CustomBlockDataEvent(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull org.bukkit.block.Block block, @NotNull org.bukkit.event.Event bukkitEvent)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.block.Block
    Gets the block involved in this event.
    @NotNull org.bukkit.event.Event
    Gets the underlying Bukkit Event that has caused this event to be called.
    Gets the CustomBlockData involved in this event.
    static @NotNull org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
     
    Gets the reason for this change of CustomBlockData
    boolean
    Gets the cancellation status of this event.
    void
    setCancelled(boolean cancel)
    Sets the cancellation status of this event.

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      @NotNull public @NotNull 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 org.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:
      setCancelled in interface org.bukkit.event.Cancellable
    • getReason

      @NotNull public @NotNull CustomBlockDataEvent.Reason 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:
      getHandlers in class org.bukkit.event.Event