Package com.destroystokyo.paper.event.player

# 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

## Nested Class Summary

## Nested classes/interfaces inherited from class org.bukkit.event.Event

`Event.Result`

## Field Summary

### Fields inherited from class org.bukkit.event.player.PlayerEvent

`player`

## Constructor Summary

Constructors
Constructor
Description
`PlayerAttackEntityCooldownResetEvent(@NotNull Player who, @NotNull Entity attackedEntity, float cooledAttackStrength)`

## Method Summary

Modifier and Type
Method
Description
`@NotNull Entity`
`getAttackedEntity()`
Returns the entity attacked by the player
`float`
`getCooledAttackStrength()`
Get the value of the players cooldown attack strength when they initiated the attack
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`boolean`
`isCancelled()`
Gets the cancellation state of this event.
`void`
`setCancelled(boolean cancel)`
Cancelling this event will prevent the target player from having their cooldown reset from attacking this entity

### Methods inherited from class org.bukkit.event.player.PlayerEvent

`getPlayer`

### 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

### PlayerAttackEntityCooldownResetEvent

public PlayerAttackEntityCooldownResetEvent(@NotNull @NotNull Player who, @NotNull @NotNull Entity attackedEntity, float cooledAttackStrength)

## 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