Class SlimefunItemSpawnEvent

java.lang.Object
org.bukkit.event.Event
io.github.thebusybiscuit.slimefun4.api.events.SlimefunItemSpawnEvent
All Implemented Interfaces:
Cancellable

public class SlimefunItemSpawnEvent extends Event implements 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:
  • Constructor Details

  • Method Details

    • getPlayer

      @Nonnull public Optional<Player> getPlayer()
      Optionally returns the Player responsible for this spawn reason.
      Returns:
      The player responsible if applicable.
    • getItemSpawnReason

      @Nonnull public ItemSpawnReason getItemSpawnReason()
      This returns the ItemSpawnReason why we dropped an ItemStack.
      Returns:
      the ItemSpawnReason.
    • getLocation

      @Nonnull public Location getLocation()
      This returns the Location where we will drop the item.
      Returns:
      The Location where the item will be dropped
    • setLocation

      public void setLocation(@Nonnull Location location)
      This sets the Location on where to drop this item.
      Parameters:
      location - The Location where to drop the ItemStack
    • getItemStack

      @Nonnull public ItemStack getItemStack()
      This returns the ItemStack that will be dropped.
      Returns:
      The ItemStack that will be dropped
    • setItemStack

      public void setItemStack(@Nonnull ItemStack itemStack)
      This method sets the ItemStack that should be dropped.
      Parameters:
      itemStack - The ItemStack to drop
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface Cancellable
    • setCancelled

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface Cancellable
    • getHandlerList

      @Nonnull public static HandlerList getHandlerList()
    • getHandlers

      @Nonnull public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event