Package com.destroystokyo.paper.event.entity

# Class EndermanAttackPlayerEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent

All Implemented Interfaces:
  `Cancellable`

public class EndermanAttackPlayerEvent extends EntityEvent implements 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

Constructors
Constructor
Description
`EndermanAttackPlayerEvent(@NotNull Enderman entity, @NotNull Player player)`

## Method Summary

Modifier and Type
Method
Description
`@NotNull Enderman`
`getEntity()`
The enderman considering attacking
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`@NotNull Player`
`getPlayer()`
The player the Enderman is considering attacking
`boolean`
`isCancelled()`
Gets the cancellation state of this event.
`void`
`setCancelled(boolean cancel)`
Cancels if the Enderman will attack this player

### Methods inherited from class org.bukkit.event.entity.EntityEvent

`getEntityType`

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### EndermanAttackPlayerEvent

public EndermanAttackPlayerEvent(@NotNull @NotNull Enderman entity, @NotNull @NotNull Player player)

## Method Details

### getEntity

@NotNull public @NotNull Enderman getEntity()
The enderman considering attacking

Overrides:
  `getEntity` in class `EntityEvent`
Returns:
  The enderman considering attacking

### getPlayer

@NotNull public @NotNull Player getPlayer()
The player the Enderman is considering attacking

Returns:
  The player the Enderman is considering attacking

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList 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 interface `Cancellable`
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 interface `Cancellable`
Parameters:
  `cancel` - true if you wish to cancel this event