Class ItemEdible

java.lang.Object
cn.nukkit.item.Item
cn.nukkit.item.ItemEdible
All Implemented Interfaces:
BlockID, ItemID, Cloneable
Direct Known Subclasses:
ItemApple, ItemAppleGold, ItemAppleGoldEnchanted, ItemBeefRaw, ItemBeetroot, ItemBeetrootSoup, ItemBread, ItemCarrot, ItemCarrotGolden, ItemChickenCooked, ItemChickenRaw, ItemChorusFruit, ItemCookie, ItemCustomEdible, ItemDriedKelp, ItemFish, ItemGlowBerries, ItemHoneyBottle, ItemMelon, ItemMushroomStew, ItemMuttonCooked, ItemMuttonRaw, ItemPorkchopCooked, ItemPorkchopRaw, ItemPotato, ItemPotatoBaked, ItemPumpkinPie, ItemRabbitCooked, ItemRabbitRaw, ItemRabbitStew, ItemRottenFlesh, ItemSpiderEye, ItemSteak, ItemSuspiciousStew, ItemSweetBerries

public abstract class ItemEdible extends Item
Author:
MagicDroidX (Nukkit Project)
  • Constructor Details

    • ItemEdible

      public ItemEdible(int id, Integer meta, int count, String name)
    • ItemEdible

      public ItemEdible(int id)
    • ItemEdible

      public ItemEdible(int id, Integer meta)
    • ItemEdible

      public ItemEdible(int id, Integer meta, int count)
  • Method Details

    • onClickAir

      public boolean onClickAir(Player player, Vector3 directionVector)
      Description copied from class: Item
      玩家在空气中投掷如三叉戟一样 返回物品是否改变,例如数量变化或耐久度

      Called when a player uses the item on air, for example throwing a projectile. Returns whether the item was changed, for example count decrease or durability change.

      Overrides:
      onClickAir in class Item
      Parameters:
      player - player
      directionVector - direction
      Returns:
      item changed
    • onUse

      public boolean onUse(Player player, int ticksUsed)
      Overrides:
      onUse in class Item