Class PlayerAttackEntityCooldownResetEvent

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

@NullMarked 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

    • PlayerAttackEntityCooldownResetEvent

      @Internal public PlayerAttackEntityCooldownResetEvent(Player player, Entity attackedEntity, float cooledAttackStrength)
  • Method Details

    • 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

      public Entity getAttackedEntity()
      Returns the entity attacked by the player
      Returns:
      the entity attacked by the player
    • 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)
      Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

      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
    • getHandlers

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

      public static HandlerList getHandlerList()