Class BlockPersistentDataWriteEvent

java.lang.Object
org.bukkit.event.Event
me.thehandsomeyoni.persistentdataapi.events.manager.PersistentDataEvent
me.thehandsomeyoni.persistentdataapi.events.block.BlockPersistentDataWriteEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class BlockPersistentDataWriteEvent extends PersistentDataEvent
A custom event that is called when a block's persistent data is written.
Since:
1.8.0
Author:
TheHandsomeYoni
  • Constructor Details

    • BlockPersistentDataWriteEvent

      public BlockPersistentDataWriteEvent(org.bukkit.block.Block block, AbstractPersistentData persistentData)
      Initializes the BlockPersistentDataWriteEvent.
      Parameters:
      block - The block that the persistent data is being written to.
      persistentData - The persistent data that is being written.
    • BlockPersistentDataWriteEvent

      public BlockPersistentDataWriteEvent(org.bukkit.block.Block block, String dataName, Serializable dataValue)
      Initializes the BlockPersistentDataWriteEvent.
      Parameters:
      block - The block that the persistent data is being written to.
      dataName - The name of the persistent data.
      dataValue - The value of the persistent data.
  • Method Details

    • isCancelled

      public boolean isCancelled()
      Checks if the event is cancelled.
      Returns:
      True if the event is cancelled, false otherwise.
    • setCancelled

      public void setCancelled(boolean cancel)
      Sets the event to cancelled.
      Parameters:
      cancel - True if the event should be cancelled, false otherwise.
    • getHandlers

      public org.bukkit.event.HandlerList getHandlers()
      Gets handlers.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      The handlers.
    • getPersistentData

      public AbstractPersistentData getPersistentData()
      Gets the persistent data.
      Specified by:
      getPersistentData in class PersistentDataEvent
      Returns:
      The persistent data.
    • getDataName

      public String getDataName()
      gets the name of the written data
      Specified by:
      getDataName in class PersistentDataEvent
      Returns:
      the name of the written data
    • getDataValue

      public Serializable getDataValue()
      gets the value of the written data
      Specified by:
      getDataValue in class PersistentDataEvent
      Returns:
      the value of the written data
    • getBlock

      public org.bukkit.block.Block getBlock()
      Gets the associated block.
      Returns:
      The associated block.