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 @Deprecated(since="26.1", forRemoval=true) public class PlayerAttackEntityCooldownResetEvent extends PlayerEvent implements Cancellable
Deprecated, for removal: This API element is subject to removal in a future version.
In modern Minecraft, this does not properly represent spear attacks and additionally does not cover the wide range of ways that the cooldown may be reset.

Additionally, the cancellation of event is misleading as the client will reset the cooldown manually. So there is no way for the server to control this.

Called when processing a player's attack on an entity when the player's attack strength cooldown is reset.
  • Nested Class Summary

    Nested classes/interfaces inherited from class Event

    Event.Result
  • Field Summary

    Fields inherited from class PlayerEvent

    player
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlayerAttackEntityCooldownResetEvent(Player player, Entity attackedEntity, float cooledAttackStrength)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the entity attacked by the player
    float
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the value of the players cooldown attack strength when they initiated the attack
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the cancellation state of this event.
    void
    setCancelled(boolean cancel)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the cancellation state of this event.

    Methods inherited from class PlayerEvent

    getPlayer

    Methods inherited from class Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlayerAttackEntityCooldownResetEvent

      @Internal public PlayerAttackEntityCooldownResetEvent(Player player, Entity attackedEntity, float cooledAttackStrength)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getCooledAttackStrength

      public float getCooledAttackStrength()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the entity attacked by the player
      Returns:
      the entity attacked by the player
    • isCancelled

      public boolean isCancelled()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()
      Deprecated, for removal: This API element is subject to removal in a future version.