Class EntityLungeEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
io.papermc.paper.event.entity.EntityLungeEvent
- All Implemented Interfaces:
Cancellable
Called when a living entity tries to lunge with a spear
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class EntityEvent
entity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListintGets the lunge power, which when initially passed, matches the enchantment level of the item, but can be higher.booleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Set whether to cancel the lunge.voidsetLungePower(int lungePower) Sets the lunge power.Methods inherited from class EntityEvent
getEntity, getEntityTypeMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
EntityLungeEvent
-
-
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: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:
trueif 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:
setCancelledin interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-