Class ItemArmor

java.lang.Object
cn.nukkit.item.Item
cn.nukkit.item.ItemArmor
All Implemented Interfaces:
BlockID, ItemDurable, ItemID, Cloneable
Direct Known Subclasses:
ItemBootsChain, ItemBootsDiamond, ItemBootsGold, ItemBootsIron, ItemBootsNetherite, ItemChestplateChain, ItemChestplateDiamond, ItemChestplateGold, ItemChestplateIron, ItemChestplateNetherite, ItemColorArmor, ItemCustomArmor, ItemElytra, ItemHelmetChain, ItemHelmetDiamond, ItemHelmetGold, ItemHelmetIron, ItemHelmetNetherite, ItemLeggingsChain, ItemLeggingsDiamond, ItemLeggingsGold, ItemLeggingsIron, ItemLeggingsNetherite, ItemTurtleShell

public abstract class ItemArmor extends Item implements ItemDurable
Author:
MagicDroidX (Nukkit Project)
  • Field Details

  • Constructor Details

    • ItemArmor

      public ItemArmor(int id)
    • ItemArmor

      public ItemArmor(int id, Integer meta)
    • ItemArmor

      public ItemArmor(int id, Integer meta, int count)
    • ItemArmor

      public ItemArmor(int id, Integer meta, int count, String name)
  • Method Details

    • getMaxStackSize

      public int getMaxStackSize()
      Description copied from class: Item
      定义物品堆叠的最大数量

      Define the maximum number of items to be stacked

      Overrides:
      getMaxStackSize in class Item
    • isArmor

      public boolean isArmor()
      Description copied from class: Item
      定义物品是否为盔甲

      Define if the item is a Armor

      Overrides:
      isArmor in class Item
    • onClickAir

      @PowerNukkitDifference(info="Using new method to play sounds", since="1.4.0.0-PN") 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 - 点击的方向向量
      The direction vector of the click
      Returns:
      item changed
    • getEnchantAbility

      public int getEnchantAbility()
      Description copied from class: Item
      定义物品的附魔

      Define the enchantment of an item

      Overrides:
      getEnchantAbility in class Item
    • isUnbreakable

      public boolean isUnbreakable()
      Description copied from class: Item
      定义物品是否不可损坏

      Define if the item is Unbreakable

      Overrides:
      isUnbreakable in class Item