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
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
-
Method Summary
Modifier and TypeMethodDescriptionReturns the Entity involved in this eventstatic @NotNull HandlerList
int
Get the new puff state of thePufferFish
.boolean
Gets the cancellation state of this event.boolean
Get if thePufferFish
is going to deflate.boolean
Get if thePufferFish
is going to inflate.void
setCancelled
(boolean cancel) Set whether or not to cancel thePufferFish
(in/de)flating.Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntityType
Methods inherited from class org.bukkit.event.Event
asynchronous, callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PufferFishStateChangeEvent
-
-
Method Details
-
getEntity
Description copied from class:EntityEvent
Returns the Entity involved in this event- Overrides:
getEntity
in classEntityEvent
- Returns:
- Entity who is involved in this event
-
getNewPuffState
public int getNewPuffState()Get the new puff state of thePufferFish
.This is what the
PufferFish
's new puff state will be after this event if it isn't cancelled.
Refer toPufferFish.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 thePufferFish
is going to inflate.- Returns:
- If its going to inflate
-
isDeflating
public boolean isDeflating()Get if thePufferFish
is going to deflate.- Returns:
- If its going to deflate
-
setCancelled
public void setCancelled(boolean cancel) Set whether or not to cancel thePufferFish
(in/de)flating.- Specified by:
setCancelled
in interfaceCancellable
- 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 interfaceCancellable
- Returns:
- true if this event is cancelled
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-