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.

  • Constructor Details

  • 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
    • 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)
      Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
      Cancels if the Enderman will attack this player
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancel - true if you wish to cancel this event
    • getHandlers

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

      @NotNull public static @NotNull HandlerList getHandlerList()