Class ItemTool

java.lang.Object
cn.nukkit.item.Item
cn.nukkit.item.ItemTool
All Implemented Interfaces:
BlockID, ItemDurable, ItemID, Cloneable
Direct Known Subclasses:
ItemAxeDiamond, ItemAxeGold, ItemAxeIron, ItemAxeNetherite, ItemAxeStone, ItemAxeWood, ItemBow, ItemCarrotOnAStick, ItemCrossbow, ItemFishingRod, ItemFlintSteel, ItemHoeDiamond, ItemHoeGold, ItemHoeIron, ItemHoeNetherite, ItemHoeStone, ItemHoeWood, ItemPickaxeDiamond, ItemPickaxeGold, ItemPickaxeIron, ItemPickaxeNetherite, ItemPickaxeStone, ItemPickaxeWood, ItemShears, ItemShield, ItemShovelDiamond, ItemShovelGold, ItemShovelIron, ItemShovelNetherite, ItemShovelStone, ItemShovelWood, ItemSwordDiamond, ItemSwordGold, ItemSwordIron, ItemSwordNetherite, ItemSwordStone, ItemSwordWood, ItemTrident, ItemWarpedFungusOnAStick

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

    • TIER_WOODEN

      public static final int TIER_WOODEN
      See Also:
    • TIER_GOLD

      public static final int TIER_GOLD
      See Also:
    • TIER_STONE

      public static final int TIER_STONE
      See Also:
    • TIER_IRON

      public static final int TIER_IRON
      See Also:
    • TIER_DIAMOND

      public static final int TIER_DIAMOND
      See Also:
    • TIER_NETHERITE

      @Since("1.4.0.0-PN") public static final int TIER_NETHERITE
      See Also:
    • TYPE_NONE

      public static final int TYPE_NONE
      See Also:
    • TYPE_SWORD

      public static final int TYPE_SWORD
      See Also:
    • TYPE_SHOVEL

      public static final int TYPE_SHOVEL
      See Also:
    • TYPE_PICKAXE

      public static final int TYPE_PICKAXE
      See Also:
    • TYPE_AXE

      public static final int TYPE_AXE
      See Also:
    • TYPE_SHEARS

      public static final int TYPE_SHEARS
      See Also:
    • TYPE_HOE

      @Since("1.4.0.0-PN") public static final int TYPE_HOE
      See Also:
    • TYPE_HANDS_ONLY

      @PowerNukkitOnly public static final int TYPE_HANDS_ONLY
      Same breaking speed independent of the tool.
    • DURABILITY_WOODEN

      public static final int DURABILITY_WOODEN
    • DURABILITY_GOLD

      public static final int DURABILITY_GOLD
    • DURABILITY_STONE

      public static final int DURABILITY_STONE
    • DURABILITY_IRON

      public static final int DURABILITY_IRON
    • DURABILITY_DIAMOND

      public static final int DURABILITY_DIAMOND
    • DURABILITY_NETHERITE

      @Since("1.4.0.0-PN") public static final int DURABILITY_NETHERITE
    • DURABILITY_FLINT_STEEL

      public static final int DURABILITY_FLINT_STEEL
    • DURABILITY_SHEARS

      public static final int DURABILITY_SHEARS
    • DURABILITY_BOW

      public static final int DURABILITY_BOW
    • DURABILITY_TRIDENT

      public static final int DURABILITY_TRIDENT
    • DURABILITY_FISHING_ROD

      public static final int DURABILITY_FISHING_ROD
    • DURABILITY_CROSSBOW

      @Since("1.4.0.0-PN") public static final int DURABILITY_CROSSBOW
    • DURABILITY_CARROT_ON_A_STICK

      @Since("FUTURE") public static final int DURABILITY_CARROT_ON_A_STICK
    • DURABILITY_WARPED_FUNGUS_ON_A_STICK

      @Since("FUTURE") public static final int DURABILITY_WARPED_FUNGUS_ON_A_STICK
    • DURABILITY_SHIELD

      @Since("FUTURE") @PowerNukkitOnly public static final int DURABILITY_SHIELD
  • Constructor Details

    • ItemTool

      public ItemTool(int id)
    • ItemTool

      public ItemTool(int id, Integer meta)
    • ItemTool

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

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

    • getBestTool

      @PowerNukkitOnly @Since("1.4.0.0-PN") @Nonnull public static Item getBestTool(int toolType)
    • getMaxStackSize

      public int getMaxStackSize()
      Overrides:
      getMaxStackSize in class Item
    • useOn

      public boolean useOn(Block block)
      Overrides:
      useOn in class Item
    • useOn

      public boolean useOn(Entity entity)
      Overrides:
      useOn in class Item
    • isUnbreakable

      public boolean isUnbreakable()
      Overrides:
      isUnbreakable in class Item
    • isPickaxe

      public boolean isPickaxe()
      Overrides:
      isPickaxe in class Item
    • isAxe

      public boolean isAxe()
      Overrides:
      isAxe in class Item
    • isSword

      public boolean isSword()
      Overrides:
      isSword in class Item
    • isShovel

      public boolean isShovel()
      Overrides:
      isShovel in class Item
    • isHoe

      public boolean isHoe()
      Overrides:
      isHoe in class Item
    • isShears

      public boolean isShears()
      Overrides:
      isShears in class Item
    • isTool

      public boolean isTool()
      Overrides:
      isTool in class Item
    • getEnchantAbility

      public int getEnchantAbility()
      Overrides:
      getEnchantAbility in class Item
    • noDamageOnAttack

      @Since("FUTURE") public boolean noDamageOnAttack()
      No damage to item when it's used to attack entities
      Returns:
      whether the item should take damage when used to attack entities
    • noDamageOnBreak

      @Since("FUTURE") public boolean noDamageOnBreak()
      No damage to item when it's used to break blocks
      Returns:
      whether the item should take damage when used to break blocks