Package org.bukkit.event.block
Class TNTPrimeEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
org.bukkit.event.block.TNTPrimeEvent
- All Implemented Interfaces:
Cancellable
Called when a block of TNT in the world become primed.
If a TNT Prime event is cancelled, the block of TNT will not become primed.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
An enum to represent the cause of a TNT block becoming primed.Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.block.BlockEvent
block
-
Constructor Summary
ConstructorDescriptionTNTPrimeEvent
(@NotNull Block block, @NotNull TNTPrimeEvent.PrimeCause igniteCause, @Nullable Entity primingEntity, @Nullable Block primingBlock) -
Method Summary
Modifier and TypeMethodDescriptiongetCause()
Get the cause of the TNT becoming primed.static @NotNull HandlerList
Get the block that caused the TNT to be primed.Get the entity that caused the TNT to be primed.boolean
Gets the cancellation state of this event.void
setCancelled
(boolean cancel) Sets the cancellation state of this event.Methods inherited from class org.bukkit.event.block.BlockEvent
getBlock
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
TNTPrimeEvent
-
-
Method Details
-
isCancelled
public boolean isCancelled()Description copied from interface:Cancellable
Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelled
in interfaceCancellable
- Returns:
- true if this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:Cancellable
Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
setCancelled
in interfaceCancellable
- Parameters:
cancel
- true if you wish to cancel this event
-
getCause
Get the cause of the TNT becoming primed.- Returns:
- the cause
-
getPrimingEntity
Get the entity that caused the TNT to be primed.- Returns:
- the entity that caused the TNT to be primed, or null if it was not caused by an entity.
-
getPrimingBlock
Get the block that caused the TNT to be primed.- Returns:
- the block that caused the TNT to be primed, or null if it was not caused by a block.
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-