Package io.papermc.paper.event.entity

# Class PufferFishStateChangeEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
io.papermc.paper.event.entity.PufferFishStateChangeEvent

All Implemented Interfaces:
  `Cancellable`

public class PufferFishStateChangeEvent extends EntityEvent implements Cancellable
Called just before a `PufferFish` inflates or deflates.

## Nested Class Summary

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

`Event.Result`

## Field Summary

### Fields inherited from class org.bukkit.event.entity.EntityEvent

`entity`

## Constructor Summary

Constructors
Constructor
Description
`PufferFishStateChangeEvent(@NotNull PufferFish entity, int newPuffState)`

## Method Summary

Modifier and Type
Method
Description
`@NotNull PufferFish`
`getEntity()`
Returns the Entity involved in this event
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`int`
`getNewPuffState()`
Get the new puff state of the `PufferFish`.
`boolean`
`isCancelled()`
Gets the cancellation state of this event.
`boolean`
`isDeflating()`
Get if the `PufferFish` is going to deflate.
`boolean`
`isInflating()`
Get if the `PufferFish` is going to inflate.
`void`
`setCancelled(boolean cancel)`
Set whether or not to cancel the `PufferFish` (in/de)flating.

### Methods inherited from class org.bukkit.event.entity.EntityEvent

`getEntityType`

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

### PufferFishStateChangeEvent

public PufferFishStateChangeEvent(@NotNull @NotNull PufferFish entity, int newPuffState)

## Method Details

### getEntity

@NotNull public @NotNull PufferFish getEntity()
Description copied from class: `EntityEvent`
Returns the Entity involved in this event

Overrides:
  `getEntity` in class `EntityEvent`
Returns:
  Entity who is involved in this event

### getNewPuffState

public int getNewPuffState()
Get the new puff state of the `PufferFish`.

This is what the `PufferFish`'s new puff state will be after this event if it isn't cancelled.
Refer to `PufferFish.getPuffState()` to get the current puff state.

Returns:
  The new puff state, 0 being not inflated, 1 being slightly inflated and 2 being fully inflated

### isInflating

public boolean isInflating()
Get if the `PufferFish` is going to inflate.

Returns:
  If its going to inflate

### isDeflating

public boolean isDeflating()
Get if the `PufferFish` is going to deflate.

Returns:
  If its going to deflate

### setCancelled

public void setCancelled(boolean cancel)
Set whether or not to cancel the `PufferFish` (in/de)flating.

Specified by:
  `setCancelled` in interface `Cancellable`
Parameters:
  `cancel` - true if you wish to cancel the (in/de)flation

### 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 interface `Cancellable`
Returns:
  true if this event is cancelled

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()