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.HandlerListorg.bukkit.event.HandlerListThis returns theItemSpawnReasonwhy we dropped anItemStack.org.bukkit.inventory.ItemStackThis returns theItemStackthat will be dropped.org.bukkit.LocationThis returns theLocationwhere we will drop the item.Optional<org.bukkit.entity.Player> Optionally returns thePlayerresponsible for this spawn reason.booleanvoidsetCancelled(boolean cancelled) voidsetItemStack(org.bukkit.inventory.ItemStack itemStack) This method sets theItemStackthat should be dropped.voidsetLocation(org.bukkit.Location location) This sets theLocationon 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 thePlayerresponsible for this spawn reason.- Returns:
- The player responsible if applicable.
-
getItemSpawnReason
This returns theItemSpawnReasonwhy we dropped anItemStack.- Returns:
- the
ItemSpawnReason.
-
getLocation
@Nonnull public org.bukkit.Location getLocation()This returns theLocationwhere we will drop the item.- Returns:
- The
Locationwhere the item will be dropped
-
setLocation
public void setLocation(@Nonnull org.bukkit.Location location) This sets theLocationon where to drop this item.- Parameters:
location- TheLocationwhere to drop theItemStack
-
getItemStack
@Nonnull public org.bukkit.inventory.ItemStack getItemStack()This returns theItemStackthat will be dropped.- Returns:
- The
ItemStackthat will be dropped
-
setItemStack
public void setItemStack(@Nonnull org.bukkit.inventory.ItemStack itemStack) This method sets theItemStackthat should be dropped.- Parameters:
itemStack- TheItemStackto drop
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlerList
@Nonnull public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
@Nonnull public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-