From 6a0096dd86f8a491bb7da441e36ef961f25dc07c Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 16 Aug 2020 09:32:49 +1000 Subject: [PATCH] #539: HumanEntity - add a method to make the entity drop the item they're holding By: Shane Bee --- .../src/main/java/org/bukkit/entity/HumanEntity.java | 11 +++++++++++ 1 file changed, 11 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 abe3d91428..72178c3036 100644 --- a/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java @@ -441,4 +441,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ @Deprecated public void setShoulderEntityRight(@Nullable Entity entity); + + /** + * Make the entity drop the item in their hand. + *
+ * This will force the entity to drop the item they are holding with + * an option to drop the entire {@link ItemStack} or just 1 of the items. + * + * @param dropAll True to drop entire stack, false to drop 1 of the stack + * @return True if item was dropped successfully + */ + public boolean dropItem(boolean dropAll); }