Interface ToolMaterial

All Known Implementing Classes:
ToolMaterials

public interface ToolMaterial
Defines the material stats of a ToolItem item.

To view available vanilla tool materials, visit ToolMaterials.

Mappings:
Namespace Name
official cum
intermediary net/minecraft/class_1832
named net/minecraft/item/ToolMaterial
  • Method Details

    • getDurability

      int getDurability()
      Returns the total amount of durability a ToolItem using this ToolMaterial has.

      The value returned here will set the Item.Settings max durability option when passed into ToolItem(net.minecraft.item.ToolMaterial, net.minecraft.item.Item.Settings) if the value was not already specified.

      Returns:
      the total amount of durability a ToolItem using this ToolMaterial has
      Mappings:
      Namespace Name Mixin selector
      official a Lcum;a()I
      intermediary method_8025 Lnet/minecraft/class_1832;method_8025()I
      named getDurability Lnet/minecraft/item/ToolMaterial;getDurability()I
    • getMiningSpeedMultiplier

      float getMiningSpeedMultiplier()
      Returns the mining speed bonus applied when a ToolItem using this material is breaking an appropriate block. 1.0f will result in no speed change.
      Returns:
      the mining speed bonus applied when a ToolItem using this material is breaking an appropriate block
      Mappings:
      Namespace Name Mixin selector
      official b Lcum;b()F
      intermediary method_8027 Lnet/minecraft/class_1832;method_8027()F
      named getMiningSpeedMultiplier Lnet/minecraft/item/ToolMaterial;getMiningSpeedMultiplier()F
    • getAttackDamage

      float getAttackDamage()
      Returns the attack damage bonus applied to any ToolItem using this ToolMaterial.

      In the case of MiningToolItem or SwordItem, the value returned here will be added on top of the attackDamage value passed into the tool's constructor.

      Returns:
      the attack damage bonus applied to any ToolItem using this ToolMaterial
      Mappings:
      Namespace Name Mixin selector
      official c Lcum;c()F
      intermediary method_8028 Lnet/minecraft/class_1832;method_8028()F
      named getAttackDamage Lnet/minecraft/item/ToolMaterial;getAttackDamage()F
    • getInverseTag

      TagKey<Block> getInverseTag()
      Mappings:
      Namespace Name Mixin selector
      official d Lcum;d()Lawg;
      intermediary method_58419 Lnet/minecraft/class_1832;method_58419()Lnet/minecraft/class_6862;
      named getInverseTag Lnet/minecraft/item/ToolMaterial;getInverseTag()Lnet/minecraft/registry/tag/TagKey;
    • getEnchantability

      int getEnchantability()
      Returns the enchantment value sent back to Item.getEnchantability() for tools using this material.

      By default, ToolMaterial will override Item.getEnchantability() and delegate the call back to this method.

      A higher return value will result in better enchantment results when using an Enchanting Table. The highest enchantability value in vanilla is Netherite, at 37.

      Returns:
      the enchantment value sent back to Item.getEnchantability() for tools using this material
      Mappings:
      Namespace Name Mixin selector
      official e Lcum;e()I
      intermediary method_8026 Lnet/minecraft/class_1832;method_8026()I
      named getEnchantability Lnet/minecraft/item/ToolMaterial;getEnchantability()I
    • getRepairIngredient

      Ingredient getRepairIngredient()
      Returns the Ingredient used to repair items using this ToolMaterial.

      By default, ToolMaterial will delegate Item.canRepair(ItemStack, ItemStack) back to this method.

      Returns:
      the Ingredient used to repair items using this ToolMaterial
      Mappings:
      Namespace Name Mixin selector
      official f Lcum;f()Lcxa;
      intermediary method_8023 Lnet/minecraft/class_1832;method_8023()Lnet/minecraft/class_1856;
      named getRepairIngredient Lnet/minecraft/item/ToolMaterial;getRepairIngredient()Lnet/minecraft/recipe/Ingredient;
    • createComponent

      default ToolComponent createComponent(TagKey<Block> tag)
      Mappings:
      Namespace Name Mixin selector
      official a Lcum;a(Lawg;)Lcwc;
      intermediary method_58418 Lnet/minecraft/class_1832;method_58418(Lnet/minecraft/class_6862;)Lnet/minecraft/class_9424;
      named createComponent Lnet/minecraft/item/ToolMaterial;createComponent(Lnet/minecraft/registry/tag/TagKey;)Lnet/minecraft/component/type/ToolComponent;