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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the Entity involved in this eventstatic @NotNull HandlerListintGet the new puff state of thePufferFish.booleanGets the cancellation state of this event.booleanGet if thePufferFishis going to deflate.booleanGet if thePufferFishis going to inflate.voidsetCancelled(boolean cancel) Set whether or not to cancel thePufferFish(in/de)flating.Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntityTypeMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PufferFishStateChangeEvent
-
-
Method Details
-
getEntity
Description copied from class:EntityEventReturns the Entity involved in this event- Overrides:
getEntityin 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 thePufferFishis going to inflate.- Returns:
- If its going to inflate
-
isDeflating
public boolean isDeflating()Get if thePufferFishis 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:
setCancelledin interfaceCancellable- Parameters:
cancel- true if you wish to cancel the (in/de)flation
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableGets 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:
isCancelledin interfaceCancellable- Returns:
- true if this event is cancelled
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-