From 52ec2a9db19131afb89ba53d9b47ba5fca96475f Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Sun, 23 Aug 2020 19:36:08 +0200 Subject: [PATCH] Add playPickupItemAnimation to LivingEntity --- .../java/org/bukkit/entity/LivingEntity.java | 25 +++++++++++++++++++ 1 file changed, 25 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 f9e2b5a7cd..e37ae6f764 100644 --- a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java @@ -1181,4 +1181,29 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource */ void setJumping(boolean jumping); // Paper end - entity jump API + + // Paper start - pickup animation API + /** + * Plays pickup item animation towards this entity. + *

+ * This will remove the item on the client. + *

+ * Quantity is inferred to be that of the {@link Item}. + * + * @param item item to pickup + */ + default void playPickupItemAnimation(@NotNull Item item) { + playPickupItemAnimation(item, item.getItemStack().getAmount()); + } + + /** + * Plays pickup item animation towards this entity. + *

+ * This will remove the item on the client. + * + * @param item item to pickup + * @param quantity quantity of item + */ + void playPickupItemAnimation(@NotNull Item item, int quantity); + // Paper end - pickup animation API }