# Uses of Interface
org.bukkit.util.Consumer

Packages that use Consumer
Package
Description
org.bukkit
The root package of the Bukkit API, contains generalized API classes.
org.bukkit.projectiles
Classes to represent the source of a projectile

## Uses of Consumer in org.bukkit

Methods in org.bukkit with parameters of type Consumer
Modifier and Type
Method
Description
`@NotNull Item`
World.`dropItem(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<Item> function)`
Drops an item at the specified `Location` Note that functions will run before the entity is spawned
`@NotNull Item`
World.`dropItemNaturally(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<Item> function)`
Drops an item at the specified `Location` with a random offset Note that functions will run before the entity is spawned
`boolean`
RegionAccessor.`generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Consumer<BlockState> stateConsumer)`
Creates a tree at the given `Location`
`<T extends Entity>
T`
RegionAccessor.`spawn(@NotNull Location location, @NotNull Class<T> clazz, boolean randomizeData, @Nullable Consumer<T> function)`
Creates a new entity at the given `Location` with the supplied function run before the entity is added to the world.
`default <T extends Entity>
T`
RegionAccessor.`spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<T> function)`
Spawn an entity of a specific class at the given `Location`, with the supplied function run before the entity is added to the world.
`<T extends Entity>
T`
RegionAccessor.`spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<T> function, CreatureSpawnEvent.SpawnReason reason)`
`default <T extends Entity>
T`
RegionAccessor.`spawn(@NotNull Location location, @NotNull Class<T> clazz, CreatureSpawnEvent.SpawnReason reason, @Nullable Consumer<T> function)`
`default @NotNull Entity`
RegionAccessor.`spawnEntity(@NotNull Location loc, EntityType type, CreatureSpawnEvent.SpawnReason reason, @Nullable Consumer<Entity> function)`

## Uses of Consumer in org.bukkit.projectiles

Methods in org.bukkit.projectiles with parameters of type Consumer
Modifier and Type
Method
Description
`<T extends Projectile>
T`
ProjectileSource.`launchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity, Consumer<T> function)`
Launches a `Projectile` from the ProjectileSource with an initial velocity, with the supplied function run before the entity is added to the world.