Class SlimefunItemSpawnEvent
java.lang.Object
org.bukkit.event.Event
io.github.thebusybiscuit.slimefun4.api.events.SlimefunItemSpawnEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class SlimefunItemSpawnEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
This
Event
is fired whenever slimefun drops an ItemStack
.
Creating a custom Event
for this allows other plugins to provide
compatibility with auto-pickup options or similar.- Author:
- TheBusyBiscuit
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionSlimefunItemSpawnEvent
(org.bukkit.entity.Player player, org.bukkit.Location location, org.bukkit.inventory.ItemStack itemStack, ItemSpawnReason itemSpawnReason) SlimefunItemSpawnEvent
(org.bukkit.Location location, org.bukkit.inventory.ItemStack itemStack, ItemSpawnReason itemSpawnReason) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerList
org.bukkit.event.HandlerList
This returns theItemSpawnReason
why we dropped anItemStack
.org.bukkit.inventory.ItemStack
This returns theItemStack
that will be dropped.org.bukkit.Location
This returns theLocation
where we will drop the item.Optional
<org.bukkit.entity.Player> Optionally returns thePlayer
responsible for this spawn reason.boolean
void
setCancelled
(boolean cancelled) void
setItemStack
(org.bukkit.inventory.ItemStack itemStack) This method sets theItemStack
that should be dropped.void
setLocation
(org.bukkit.Location location) This sets theLocation
on where to drop this item.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
SlimefunItemSpawnEvent
@ParametersAreNonnullByDefault public SlimefunItemSpawnEvent(@Nullable org.bukkit.entity.Player player, org.bukkit.Location location, org.bukkit.inventory.ItemStack itemStack, ItemSpawnReason itemSpawnReason) -
SlimefunItemSpawnEvent
@ParametersAreNonnullByDefault public SlimefunItemSpawnEvent(org.bukkit.Location location, org.bukkit.inventory.ItemStack itemStack, ItemSpawnReason itemSpawnReason)
-
-
Method Details
-
getPlayer
Optionally returns thePlayer
responsible for this spawn reason.- Returns:
- The player responsible if applicable.
-
getItemSpawnReason
This returns theItemSpawnReason
why we dropped anItemStack
.- Returns:
- the
ItemSpawnReason
.
-
getLocation
@Nonnull public org.bukkit.Location getLocation()This returns theLocation
where we will drop the item.- Returns:
- The
Location
where the item will be dropped
-
setLocation
public void setLocation(@Nonnull org.bukkit.Location location) This sets theLocation
on where to drop this item.- Parameters:
location
- TheLocation
where to drop theItemStack
-
getItemStack
@Nonnull public org.bukkit.inventory.ItemStack getItemStack()This returns theItemStack
that will be dropped.- Returns:
- The
ItemStack
that will be dropped
-
setItemStack
public void setItemStack(@Nonnull org.bukkit.inventory.ItemStack itemStack) This method sets theItemStack
that should be dropped.- Parameters:
itemStack
- TheItemStack
to drop
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-
getHandlerList
@Nonnull public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
@Nonnull public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-