Class BlockPersistentDataDeleteEvent
java.lang.Object
org.bukkit.event.Event
me.thehandsomeyoni.persistentdataapi.events.manager.PersistentDataEvent
me.thehandsomeyoni.persistentdataapi.events.block.BlockPersistentDataDeleteEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
A custom event that is called when a block's persistent data is deleted.
- Since:
- 1.8.0
- Author:
- TheHandsomeYoni
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionBlockPersistentDataDeleteEvent
(org.bukkit.block.Block block, String dataName) Initializes the BlockPersistentDataDeleteEvent.BlockPersistentDataDeleteEvent
(org.bukkit.block.Block block, AbstractPersistentData persistentData) Initializes the BlockPersistentDataDeleteEvent. -
Method Summary
Modifier and TypeMethodDescriptionGets the name of the persistent data that was deleted.Gets the value of the persistent data that was deleted.org.bukkit.event.HandlerList
Gets handlers.Gets the persistent data that is being deleted.boolean
Checks if the event is cancelled.void
setCancelled
(boolean cancel) Sets the event to cancelled.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
BlockPersistentDataDeleteEvent
public BlockPersistentDataDeleteEvent(org.bukkit.block.Block block, AbstractPersistentData persistentData) Initializes the BlockPersistentDataDeleteEvent.- Parameters:
block
- The block that the persistent data is being deleted from.persistentData
- The persistent data that is being deleted.
-
BlockPersistentDataDeleteEvent
Initializes the BlockPersistentDataDeleteEvent.- Parameters:
block
- The block that the persistent data is being deleted from.dataName
- The name of the persistent data.
-
-
Method Details
-
getPersistentData
Gets the persistent data that is being deleted.- Specified by:
getPersistentData
in classPersistentDataEvent
- Returns:
- The persistent data that is being deleted.
-
getDataName
Gets the name of the persistent data that was deleted.- Specified by:
getDataName
in classPersistentDataEvent
- Returns:
- The name of the persistent data that was deleted.
-
getDataValue
Gets the value of the persistent data that was deleted.- Specified by:
getDataValue
in classPersistentDataEvent
- Returns:
- The value of the persistent data that was deleted.
-
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 classorg.bukkit.event.Event
- Returns:
- The handlers.
-