mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 21:37:39 +01:00
#591: Add option for a consumer before spawning an item
By: Martoph <sager1018@gmail.com>
This commit is contained in:
parent
3df2b9e2ab
commit
d1017aa606
@ -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<Item> 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<Item> function);
|
||||
|
||||
/**
|
||||
* Creates an {@link Arrow} entity at the given {@link Location}
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user