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.
  • Constructor Details

  • 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()