Interface Item

All Superinterfaces:
CommandSender, Entity, Metadatable, Nameable, Permissible, PersistentDataHolder, ServerOperator

public interface Item extends Entity
Represents a dropped item.
  • Method Details Link icon

    • getItemStack Link icon

      @NotNull ItemStack getItemStack()
      Gets the item stack associated with this item drop.
      Returns:
      An item stack.
    • setItemStack Link icon

      void setItemStack(@NotNull ItemStack stack)
      Sets the item stack associated with this item drop.
      Parameters:
      stack - An item stack.
    • getPickupDelay Link icon

      int getPickupDelay()
      Gets the delay before this Item is available to be picked up by players
      Returns:
      Remaining delay
    • setPickupDelay Link icon

      void setPickupDelay(int delay)
      Sets the delay before this Item is available to be picked up by players
      Parameters:
      delay - New delay
    • setUnlimitedLifetime Link icon

      void setUnlimitedLifetime(boolean unlimited)
      Sets if this Item should live forever
      Parameters:
      unlimited - true if the lifetime is unlimited
    • isUnlimitedLifetime Link icon

      boolean isUnlimitedLifetime()
      Gets if this Item lives forever
      Returns:
      true if the lifetime is unlimited
    • setOwner Link icon

      void setOwner(@Nullable UUID owner)
      Sets the owner of this item. Other entities will not be able to pickup this item when an owner is set.
      Parameters:
      owner - UUID of new owner
    • getOwner Link icon

      @Nullable UUID getOwner()
      Get the owner of this item.
      Returns:
      UUID of owner
    • setThrower Link icon

      void setThrower(@Nullable UUID uuid)
      Set the thrower of this item. The thrower is the entity which dropped the item. This affects the trigger criteria for item pickups, for things such as advancements.
      Parameters:
      uuid - UUID of thrower
    • getThrower Link icon

      @Nullable UUID getThrower()
      Get the thrower of this item. The thrower is the entity which dropped the item.
      Returns:
      UUID of thrower