Interface ToolMaterial
- All Known Implementing Classes:
ToolMaterials
ToolItem item.
To view available vanilla tool materials, visit ToolMaterials.
- Mappings:
Namespace Name named net/minecraft/item/ToolMaterialintermediary net/minecraft/class_1832official cwi
-
Method Summary
Modifier and TypeMethodDescriptiondefault ToolComponentcreateComponent(TagKey<Block> tag) floatReturns the attack damage bonus applied to anyToolItemusing thisToolMaterial.intReturns the total amount of durability aToolItemusing thisToolMaterialhas.intReturns the enchantment value sent back toItem.getEnchantability()for tools using this material.floatReturns the mining speed bonus applied when aToolItemusing this material is breaking an appropriate block.Returns theIngredientused to repair items using thisToolMaterial.
-
Method Details
-
getDurability
int getDurability()Returns the total amount of durability aToolItemusing thisToolMaterialhas.The value returned here will set the
Item.Settingsmax durability option when passed intoToolItem(net.minecraft.item.ToolMaterial, net.minecraft.item.Item.Settings)if the value was not already specified.- Returns:
- the total amount of durability a
ToolItemusing thisToolMaterialhas - Mappings:
Namespace Name Mixin selector named getDurabilityLnet/minecraft/item/ToolMaterial;getDurability()Iintermediary method_8025Lnet/minecraft/class_1832;method_8025()Iofficial aLcwi;a()I
-
getMiningSpeedMultiplier
float getMiningSpeedMultiplier()Returns the mining speed bonus applied when aToolItemusing this material is breaking an appropriate block.1.0fwill result in no speed change.- Returns:
- the mining speed bonus applied when a
ToolItemusing this material is breaking an appropriate block - Mappings:
Namespace Name Mixin selector named getMiningSpeedMultiplierLnet/minecraft/item/ToolMaterial;getMiningSpeedMultiplier()Fintermediary method_8027Lnet/minecraft/class_1832;method_8027()Fofficial bLcwi;b()F
-
getAttackDamage
float getAttackDamage()Returns the attack damage bonus applied to anyToolItemusing thisToolMaterial.In the case of
MiningToolItemorSwordItem, the value returned here will be added on top of theattackDamagevalue passed into the tool's constructor.- Returns:
- the attack damage bonus applied to any
ToolItemusing thisToolMaterial - Mappings:
Namespace Name Mixin selector named getAttackDamageLnet/minecraft/item/ToolMaterial;getAttackDamage()Fintermediary method_8028Lnet/minecraft/class_1832;method_8028()Fofficial cLcwi;c()F
-
getInverseTag
- Mappings:
Namespace Name Mixin selector named getInverseTagLnet/minecraft/item/ToolMaterial;getInverseTag()Lnet/minecraft/registry/tag/TagKey;intermediary method_58419Lnet/minecraft/class_1832;method_58419()Lnet/minecraft/class_6862;official dLcwi;d()Lawu;
-
getEnchantability
int getEnchantability()Returns the enchantment value sent back toItem.getEnchantability()for tools using this material.By default,
ToolMaterialwill overrideItem.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, at37.- Returns:
- the enchantment value sent back to
Item.getEnchantability()for tools using this material - Mappings:
Namespace Name Mixin selector named getEnchantabilityLnet/minecraft/item/ToolMaterial;getEnchantability()Iintermediary method_8026Lnet/minecraft/class_1832;method_8026()Iofficial eLcwi;e()I
-
getRepairIngredient
Ingredient getRepairIngredient()Returns theIngredientused to repair items using thisToolMaterial.By default,
ToolMaterialwill delegateItem.canRepair(ItemStack, ItemStack)back to this method.- Returns:
- the
Ingredientused to repair items using thisToolMaterial - Mappings:
Namespace Name Mixin selector named getRepairIngredientLnet/minecraft/item/ToolMaterial;getRepairIngredient()Lnet/minecraft/recipe/Ingredient;intermediary method_8023Lnet/minecraft/class_1832;method_8023()Lnet/minecraft/class_1856;official fLcwi;f()Lcyw;
-
createComponent
- Mappings:
Namespace Name Mixin selector named createComponentLnet/minecraft/item/ToolMaterial;createComponent(Lnet/minecraft/registry/tag/TagKey;)Lnet/minecraft/component/type/ToolComponent;intermediary method_58418Lnet/minecraft/class_1832;method_58418(Lnet/minecraft/class_6862;)Lnet/minecraft/class_9424;official aLcwi;a(Lawu;)Lcxx;
-