Class ToolItem

java.lang.Object
net.minecraft.item.Item
net.minecraft.item.ToolItem
All Implemented Interfaces:
ItemConvertible
Direct Known Subclasses:
MiningToolItem, SwordItem

public class ToolItem
extends Item
  • Field Details

  • Constructor Details

  • Method Details

    • getMaterial

      public ToolMaterial getMaterial()
    • getEnchantability

      public int getEnchantability()
      Gets the enchantability of an item. This specifies the ability of an item to receive enchantments when enchanted using an enchanting table. As the value increases, the amount and level of enchantments applied increase.

      If the value of this method is 0, the item cannot be enchanted using an enchanting table.

      Overrides:
      getEnchantability in class Item
    • canRepair

      public boolean canRepair​(ItemStack stack, ItemStack ingredient)
      Overrides:
      canRepair in class Item