Class EndermanAttackPlayerEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent
- All Implemented Interfaces:
Cancellable
Fired when an Enderman determines if it should attack a player or not.
Starts off cancelled if the player is wearing a pumpkin head or is not looking
at the Enderman, according to Vanilla rules.
-
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
ConstructorDescriptionEndermanAttackPlayerEvent(@NotNull Enderman entity, @NotNull Player player)
-
Method Summary
Modifier and TypeMethodDescriptionThe enderman considering attackingstatic @NotNull HandlerList
The player the Enderman is considering attackingboolean
Gets the cancellation state of this event.void
setCancelled(boolean cancel)
Cancels if the Enderman will attack this playerMethods inherited from class org.bukkit.event.entity.EntityEvent
getEntityType
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
EndermanAttackPlayerEvent
-
-
Method Details
-
getEntity
The enderman considering attacking- Overrides:
getEntity
in classEntityEvent
- Returns:
- The enderman considering attacking
-
getPlayer
The player the Enderman is considering attacking- Returns:
- The player the Enderman is considering attacking
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-
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:
- If cancelled, the enderman will not attack
-
setCancelled
public void setCancelled(boolean cancel)Cancels if the Enderman will attack this player- Specified by:
setCancelled
in interfaceCancellable
- Parameters:
cancel
- true if you wish to cancel this event
-