From f0acc790e6cd51d182edd656faaacb48bd20051a Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 30 Mar 2024 12:54:17 +1100 Subject: [PATCH] #959: Add access to current item's remaining ticks By: gIsForGravity --- .../java/org/bukkit/entity/LivingEntity.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java index 7879082361..05af43a182 100644 --- a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java @@ -196,6 +196,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource */ public void setMaximumAir(int ticks); + /** + * Gets the number of ticks remaining for the current item's usage. + * + * @return The number of ticks remaining + */ + public int getItemInUseTicks(); + + /** + * Sets the number of ticks that remain for the current item's usage. + * Applies to items that take time to use, like eating food, drawing a bow, + * or throwing a trident. + * + * @param ticks The number of ticks remaining + */ + public void setItemInUseTicks(int ticks); + /** * Gets the time in ticks until the next arrow leaves the entity's body. *