Class EntityLungeEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
io.papermc.paper.event.entity.EntityLungeEvent
All Implemented Interfaces:
Cancellable

@NullMarked public class EntityLungeEvent extends EntityEvent implements Cancellable
Called when a living entity tries to lunge with a spear
  • Constructor Details

  • Method Details

    • getLungePower

      public int getLungePower()
      Gets the lunge power, which when initially passed, matches the enchantment level of the item, but can be higher.
      Returns:
      the lunge power
    • setLungePower

      public void setLungePower(int lungePower)
      Sets the lunge power. This commonly matches the enchantment level of the item, and can be set higher.

      If set higher than 3, the power of the lunge will continue to scale like normal, as if the max enchantment level is higher.

      Parameters:
      lungePower - the new lunge power
    • 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
    • setCancelled

      public void setCancelled(boolean cancel)
      Set whether to cancel the lunge. If cancelled, the living entity will not lunge forward.
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancel - true if you wish to cancel this event
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()