Class DropsToInventoryEvent

java.lang.Object
org.bukkit.event.Event
com.vk2gpz.autosell.event.DropsToInventoryEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class DropsToInventoryEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
This event is called when a player picks up dropped items. It is used to transfer the picked items into player's inventory.

This event is cancellable, and if cancelled, the items will not be picked up.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    DropsToInventoryEvent(org.bukkit.entity.Player p, List<org.bukkit.inventory.ItemStack> drops, org.bukkit.block.Block block, int xp)
    Creates a new DropsToInventoryEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.block.Block
    Gets the block that the items were dropped from.
    List<org.bukkit.inventory.ItemStack>
    Gets the items that were picked up.
    static org.bukkit.event.HandlerList
    Gets the handler list for this event.
    @NotNull org.bukkit.event.HandlerList
    Gets the handler list for this event.
    Gets the name of the player.
    org.bukkit.entity.Player
    Gets the player who picked up the items.
    int
    Gets the amount of experience that was dropped.
    boolean
    Checks if the event is cancelled or not.
    void
    setBlock(org.bukkit.block.Block block)
    Sets the block that the items were dropped from.
    void
    setCancelled(boolean cancelled)
    Sets whether the event is cancelled or not.
    void
    setDrops(List<org.bukkit.inventory.ItemStack> drops)
    Sets the items that were picked up.
    void
    setXp(int xp)
    Sets the amount of experience that was dropped.

    Methods inherited from class org.bukkit.event.Event

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DropsToInventoryEvent

      public DropsToInventoryEvent(org.bukkit.entity.Player p, List<org.bukkit.inventory.ItemStack> drops, org.bukkit.block.Block block, int xp)
      Creates a new DropsToInventoryEvent.
      Parameters:
      p - The player who picked up the items.
      drops - The items that were picked up.
      block - The block that the items were dropped from.
      xp - The amount of experience that was dropped.
  • Method Details

    • getName

      public String getName()
      Gets the name of the player.
      Returns:
      the name of the player.
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Gets the player who picked up the items.
      Returns:
      the player who picked up the items.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Gets the handler list for this event.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      the handler list for this event.
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
      Gets the handler list for this event.
      Returns:
      the handler list for this event.
    • isCancelled

      public boolean isCancelled()
      Checks if the event is cancelled or not.
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      Whether the event is cancelled or not.
    • setCancelled

      public void setCancelled(boolean cancelled)
      Sets whether the event is cancelled or not.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancelled -
    • getDrops

      public List<org.bukkit.inventory.ItemStack> getDrops()
      Gets the items that were picked up.
      Returns:
      The items that were picked up.
    • setDrops

      public void setDrops(List<org.bukkit.inventory.ItemStack> drops)
      Sets the items that were picked up.
      Parameters:
      drops - The items that were picked up.
    • getBlock

      public org.bukkit.block.Block getBlock()
      Gets the block that the items were dropped from.
      Returns:
      The block that the items were dropped from.
    • setBlock

      public void setBlock(org.bukkit.block.Block block)
      Sets the block that the items were dropped from.
      Parameters:
      block - The block that the items were dropped from.
    • getXp

      public int getXp()
      Gets the amount of experience that was dropped.
      Returns:
      The amount of experience that was dropped.
    • setXp

      public void setXp(int xp)
      Sets the amount of experience that was dropped.
      Parameters:
      xp - The amount of experience that was dropped.