diff --git a/paper-api/src/main/java/org/bukkit/World.java b/paper-api/src/main/java/org/bukkit/World.java index f36ad196f5..3240d10111 100644 --- a/paper-api/src/main/java/org/bukkit/World.java +++ b/paper-api/src/main/java/org/bukkit/World.java @@ -471,6 +471,18 @@ public interface World extends PluginMessageRecipient, Metadatable { @NotNull public Item dropItem(@NotNull Location location, @NotNull ItemStack item); + /** + * Drops an item at the specified {@link Location} + * Note that functions will run before the entity is spawned + * + * @param location Location to drop the item + * @param item ItemStack to drop + * @param function the function to be run before the entity is spawned. + * @return ItemDrop entity created as a result of this method + */ + @NotNull + public Item dropItem(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer function); + /** * Drops an item at the specified {@link Location} with a random offset * @@ -481,6 +493,18 @@ public interface World extends PluginMessageRecipient, Metadatable { @NotNull public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item); + /** + * Drops an item at the specified {@link Location} with a random offset + * Note that functions will run before the entity is spawned + * + * @param location Location to drop the item + * @param item ItemStack to drop + * @param function the function to be run before the entity is spawned. + * @return ItemDrop entity created as a result of this method + */ + @NotNull + public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer function); + /** * Creates an {@link Arrow} entity at the given {@link Location} *