Class PlayerAttackEntityCooldownResetEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
com.destroystokyo.paper.event.player.PlayerAttackEntityCooldownResetEvent
All Implemented Interfaces:
Cancellable

public class PlayerAttackEntityCooldownResetEvent extends PlayerEvent implements Cancellable
Called when processing a player's attack on an entity when the player's attack strength cooldown is reset
  • Constructor Details

  • Method Details

    • getHandlers

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

      @NotNull public static @NotNull HandlerList getHandlerList()
    • isCancelled

      public boolean isCancelled()
      Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

      If an attack cooldown event is cancelled, the players attack strength will remain at the same value instead of being reset.

      Specified by:
      isCancelled in interface Cancellable
      Returns:
      true if this event is cancelled
    • setCancelled

      public void setCancelled(boolean cancel)
      Cancelling this event will prevent the target player from having their cooldown reset from attacking this entity
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancel - true if you wish to cancel this event
    • getCooledAttackStrength

      public float getCooledAttackStrength()
      Get the value of the players cooldown attack strength when they initiated the attack
      Returns:
      returns the original player cooldown value
    • getAttackedEntity

      @NotNull public @NotNull Entity getAttackedEntity()
      Returns the entity attacked by the player
      Returns:
      the entity attacked by the player