From 711bd7b6f72a751e18840118febcc3847a5b8a9c Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 23 Apr 2020 11:13:44 +1000 Subject: [PATCH] #486: Add method to get player's attack cooldown By: DiamondDagger590 --- .../src/main/java/org/bukkit/entity/HumanEntity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java b/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java index 6277f39288..a7f08bb1c0 100644 --- a/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java @@ -324,6 +324,16 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public int getExpToLevel(); + /** + * Gets the current cooldown for a player's attack. + * + * This is used to calculate damage, with 1.0 representing a fully charged + * attack and 0.0 representing a non-charged attack + * + * @return A float between 0.0-1.0 representing the progress of the charge + */ + public float getAttackCooldown(); + /** * Discover a recipe for this player such that it has not already been * discovered. This method will add the key's associated recipe to the