接口 Item

所有超级接口:
CommandSender, Entity, Metadatable, Nameable, Permissible, PersistentDataHolder, ServerOperator

public interface Item extends Entity
代表掉落物实体.
  • 方法详细资料

    • getItemStack

      @NotNull @NotNull ItemStack getItemStack()
      获取与此掉落物相关的物品堆.

      原文:Gets the item stack associated with this item drop.

      返回:
      物品堆
    • setItemStack

      void setItemStack(@NotNull @NotNull ItemStack stack)
      设置与此掉落物相关的物品堆.

      原文:Sets the item stack associated with this item drop.

      参数:
      stack - 物品堆
    • getPickupDelay

      int getPickupDelay()
      获取此掉落物剩余的不可被捡起的时间.

      原文:Gets the delay before this Item is available to be picked up by players

      返回:
      掉落物剩余的不可被捡起的时间
    • setPickupDelay

      void setPickupDelay(int delay)
      设置掉落物剩余的不可被捡起的时间.

      原文:Sets the delay before this Item is available to be picked up by players

      参数:
      delay - 掉落物剩余的不可被捡起的时间
    • setUnlimitedLifetime

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

      boolean isUnlimitedLifetime()
      Gets if this Item lives forever
      返回:
      true if the lifetime is unlimited
    • setOwner

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

      Get the owner of this item.
      返回:
      UUID of owner
    • setThrower

      void setThrower(@Nullable @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.
      参数:
      uuid - UUID of thrower
    • getThrower

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