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.
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
ConstructorsConstructorDescriptionPlayerAttackEntityCooldownResetEvent(Player player, Entity attackedEntity, float cooledAttackStrength) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Returns the entity attacked by the playerfloatDeprecated, 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 attackstatic HandlerListDeprecated, 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.booleanDeprecated, for removal: This API element is subject to removal in a future version.Gets the cancellation state of this event.voidsetCancelled(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
getPlayerMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerAttackEntityCooldownResetEvent
-
-
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
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 pluginsIf an attack cooldown event is cancelled, the players attack strength will remain at the same value instead of being reset.
- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif 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:
setCancelledin interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getHandlersin classEvent
-
getHandlerList
Deprecated, for removal: This API element is subject to removal in a future version.
-
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.