From 0000000000000000000000000000000000000000 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 diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java index 54046c5810f9f6f3f28e815a210617683139509d..2c559c590b96753aa5dc2db2bacca32d8afad352 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -898,5 +898,28 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource * @param jumping entity jump state */ void setJumping(boolean jumping); + + /** + * 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 }