Interface ToolMaterial
- All Known Implementing Classes:
ToolMaterials
ToolItem
item.
To view available vanilla tool materials, visit ToolMaterials
.
- Mappings:
Namespace Name named net/minecraft/item/ToolMaterial
intermediary net/minecraft/class_1832
official cwg
-
Method Summary
Modifier and TypeMethodDescriptiondefault ToolComponent
createComponent
(TagKey<Block> tag) float
Returns the attack damage bonus applied to anyToolItem
using thisToolMaterial
.int
Returns the total amount of durability aToolItem
using thisToolMaterial
has.int
Returns the enchantment value sent back toItem.getEnchantability()
for tools using this material.float
Returns the mining speed bonus applied when aToolItem
using this material is breaking an appropriate block.Returns theIngredient
used to repair items using thisToolMaterial
.
-
Method Details
-
getDurability
int getDurability()Returns the total amount of durability aToolItem
using thisToolMaterial
has.The value returned here will set the
Item.Settings
max 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
ToolItem
using thisToolMaterial
has - Mappings:
Namespace Name Mixin selector named getDurability
Lnet/minecraft/item/ToolMaterial;getDurability()I
intermediary method_8025
Lnet/minecraft/class_1832;method_8025()I
official a
Lcwg;a()I
-
getMiningSpeedMultiplier
float getMiningSpeedMultiplier()Returns the mining speed bonus applied when aToolItem
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 named getMiningSpeedMultiplier
Lnet/minecraft/item/ToolMaterial;getMiningSpeedMultiplier()F
intermediary method_8027
Lnet/minecraft/class_1832;method_8027()F
official b
Lcwg;b()F
-
getAttackDamage
float getAttackDamage()Returns the attack damage bonus applied to anyToolItem
using thisToolMaterial
.In the case of
MiningToolItem
orSwordItem
, the value returned here will be added on top of theattackDamage
value passed into the tool's constructor.- Returns:
- the attack damage bonus applied to any
ToolItem
using thisToolMaterial
- Mappings:
Namespace Name Mixin selector named getAttackDamage
Lnet/minecraft/item/ToolMaterial;getAttackDamage()F
intermediary method_8028
Lnet/minecraft/class_1832;method_8028()F
official c
Lcwg;c()F
-
getInverseTag
- Mappings:
Namespace Name Mixin selector named getInverseTag
Lnet/minecraft/item/ToolMaterial;getInverseTag()Lnet/minecraft/registry/tag/TagKey;
intermediary method_58419
Lnet/minecraft/class_1832;method_58419()Lnet/minecraft/class_6862;
official d
Lcwg;d()Laxf;
-
getEnchantability
int getEnchantability()Returns the enchantment value sent back toItem.getEnchantability()
for tools using this material.By default,
ToolMaterial
will 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 getEnchantability
Lnet/minecraft/item/ToolMaterial;getEnchantability()I
intermediary method_8026
Lnet/minecraft/class_1832;method_8026()I
official e
Lcwg;e()I
-
getRepairIngredient
Ingredient getRepairIngredient()Returns theIngredient
used to repair items using thisToolMaterial
.By default,
ToolMaterial
will delegateItem.canRepair(ItemStack, ItemStack)
back to this method.- Returns:
- the
Ingredient
used to repair items using thisToolMaterial
- Mappings:
Namespace Name Mixin selector named getRepairIngredient
Lnet/minecraft/item/ToolMaterial;getRepairIngredient()Lnet/minecraft/recipe/Ingredient;
intermediary method_8023
Lnet/minecraft/class_1832;method_8023()Lnet/minecraft/class_1856;
official f
Lcwg;f()Lcyu;
-
createComponent
- Mappings:
Namespace Name Mixin selector named createComponent
Lnet/minecraft/item/ToolMaterial;createComponent(Lnet/minecraft/registry/tag/TagKey;)Lnet/minecraft/component/type/ToolComponent;
intermediary method_58418
Lnet/minecraft/class_1832;method_58418(Lnet/minecraft/class_6862;)Lnet/minecraft/class_9424;
official a
Lcwg;a(Laxf;)Lcxw;
-