Class PlayerAttackEntityCooldownResetEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
com.destroystokyo.paper.event.player.PlayerAttackEntityCooldownResetEvent
- All Implemented Interfaces:
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
ConstructorDescriptionPlayerAttackEntityCooldownResetEvent
(@NotNull Player who, @NotNull Entity attackedEntity, float cooledAttackStrength) -
Method Summary
Modifier and TypeMethodDescriptionReturns the entity attacked by the playerfloat
Get the value of the players cooldown attack strength when they initiated the attackstatic @NotNull HandlerList
boolean
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 entityMethods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerAttackEntityCooldownResetEvent
-
-
Method Details
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
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 pluginsIf an attack cooldown event is cancelled, the players attack strength will remain at the same value instead of being reset.
- Specified by:
isCancelled
in interfaceCancellable
- 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 interfaceCancellable
- 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
Returns the entity attacked by the player- Returns:
- the entity attacked by the player
-