Package com.destroystokyo.paper.event.block

# Class TNTPrimeEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
com.destroystokyo.paper.event.block.TNTPrimeEvent

All Implemented Interfaces:
  `Cancellable`

public class TNTPrimeEvent extends BlockEvent implements Cancellable
Called when TNT block is about to turn into `TNTPrimed`

Cancelling it won't turn TNT into `TNTPrimed` and leaves the TNT block as-is

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`TNTPrimeEvent.PrimeReason`

## 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

Constructors
Constructor
Description
`TNTPrimeEvent(@NotNull Block theBlock, @NotNull TNTPrimeEvent.PrimeReason reason, @Nullable Entity primerEntity)`

## Method Summary

Modifier and Type
Method
Description
`static @Nullable HandlerList`
`getHandlerList()`
`@Nullable HandlerList`
`getHandlers()`
`@Nullable Entity`
`getPrimerEntity()`
Gets the TNT primer `Entity`.
`@NotNull TNTPrimeEvent.PrimeReason`
`getReason()`
Gets the TNT prime reason
`boolean`
`isCancelled()`
Gets whether spawning `TNTPrimed` should be cancelled or not
`void`
`setCancelled(boolean cancel)`
Sets whether to cancel spawning `TNTPrimed` or not

### Methods inherited from class org.bukkit.event.block.BlockEvent

`getBlock`

### 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

### TNTPrimeEvent

public TNTPrimeEvent(@NotNull @NotNull Block theBlock, @NotNull @NotNull TNTPrimeEvent.PrimeReason reason, @Nullable @Nullable Entity primerEntity)

## Method Details

### getReason

@NotNull public @NotNull TNTPrimeEvent.PrimeReason getReason()
Gets the TNT prime reason

Returns:
  Prime reason

### getPrimerEntity

@Nullable public @Nullable Entity getPrimerEntity()
Gets the TNT primer `Entity`. It's null if `getReason()` is `TNTPrimeEvent.PrimeReason.REDSTONE` or `TNTPrimeEvent.PrimeReason.FIRE`. It's not null if `getReason()` is `TNTPrimeEvent.PrimeReason.ITEM` or `TNTPrimeEvent.PrimeReason.PROJECTILE` It might be null if `getReason()` is `TNTPrimeEvent.PrimeReason.EXPLOSION`

Returns:
  The `Entity` who primed the TNT

### isCancelled

public boolean isCancelled()
Gets whether spawning `TNTPrimed` should be cancelled or not

Specified by:
  `isCancelled` in interface `Cancellable`
Returns:
  Whether spawning `TNTPrimed` should be cancelled or not

### setCancelled

public void setCancelled(boolean cancel)
Sets whether to cancel spawning `TNTPrimed` or not

Specified by:
  `setCancelled` in interface `Cancellable`
Parameters:
  `cancel` - whether spawning `TNTPrimed` should be cancelled or not

### getHandlers

@Nullable public @Nullable HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@Nullable public static @Nullable HandlerList getHandlerList()