Package net.minecraft.item
Enum Class ToolMaterials
- All Implemented Interfaces:
Serializable,Comparable<ToolMaterials>,Constable,ToolMaterial
Provides the default
ToolMaterials used by vanilla tools.- Mappings:
Namespace Name named net/minecraft/item/ToolMaterialsintermediary net/minecraft/class_1834official cwk
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatprivate final intprivate final intprivate final floatprivate final Supplier<Ingredient> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateToolMaterials(TagKey<Block> inverseTag, int itemDurability, float miningSpeed, float attackDamage, int enchantability, Supplier<Ingredient> repairIngredient) -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns 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.static ToolMaterialsReturns the enum constant of this class with the specified name.static ToolMaterials[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface net.minecraft.item.ToolMaterial
createComponent
-
Enum Constant Details
-
WOOD
- Mappings:
Namespace Name Mixin selector named WOODLnet/minecraft/item/ToolMaterials;WOOD:Lnet/minecraft/item/ToolMaterials;intermediary field_8922Lnet/minecraft/class_1834;field_8922:Lnet/minecraft/class_1834;official aLcwk;a:Lcwk;
-
STONE
- Mappings:
Namespace Name Mixin selector named STONELnet/minecraft/item/ToolMaterials;STONE:Lnet/minecraft/item/ToolMaterials;intermediary field_8927Lnet/minecraft/class_1834;field_8927:Lnet/minecraft/class_1834;official bLcwk;b:Lcwk;
-
IRON
- Mappings:
Namespace Name Mixin selector named IRONLnet/minecraft/item/ToolMaterials;IRON:Lnet/minecraft/item/ToolMaterials;intermediary field_8923Lnet/minecraft/class_1834;field_8923:Lnet/minecraft/class_1834;official cLcwk;c:Lcwk;
-
DIAMOND
- Mappings:
Namespace Name Mixin selector named DIAMONDLnet/minecraft/item/ToolMaterials;DIAMOND:Lnet/minecraft/item/ToolMaterials;intermediary field_8930Lnet/minecraft/class_1834;field_8930:Lnet/minecraft/class_1834;official dLcwk;d:Lcwk;
-
GOLD
- Mappings:
Namespace Name Mixin selector named GOLDLnet/minecraft/item/ToolMaterials;GOLD:Lnet/minecraft/item/ToolMaterials;intermediary field_8929Lnet/minecraft/class_1834;field_8929:Lnet/minecraft/class_1834;official eLcwk;e:Lcwk;
-
NETHERITE
- Mappings:
Namespace Name Mixin selector named NETHERITELnet/minecraft/item/ToolMaterials;NETHERITE:Lnet/minecraft/item/ToolMaterials;intermediary field_22033Lnet/minecraft/class_1834;field_22033:Lnet/minecraft/class_1834;official fLcwk;f:Lcwk;
-
-
Field Details
-
inverseTag
- Mappings:
Namespace Name Mixin selector named inverseTagLnet/minecraft/item/ToolMaterials;inverseTag:Lnet/minecraft/registry/tag/TagKey;intermediary field_50006Lnet/minecraft/class_1834;field_50006:Lnet/minecraft/class_6862;official gLcwk;g:Lawu;
-
itemDurability
private final int itemDurability- Mappings:
Namespace Name Mixin selector named itemDurabilityLnet/minecraft/item/ToolMaterials;itemDurability:Iintermediary field_8924Lnet/minecraft/class_1834;field_8924:Iofficial hLcwk;h:I
-
miningSpeed
private final float miningSpeed- Mappings:
Namespace Name Mixin selector named miningSpeedLnet/minecraft/item/ToolMaterials;miningSpeed:Fintermediary field_8932Lnet/minecraft/class_1834;field_8932:Fofficial iLcwk;i:F
-
attackDamage
private final float attackDamage- Mappings:
Namespace Name Mixin selector named attackDamageLnet/minecraft/item/ToolMaterials;attackDamage:Fintermediary field_8931Lnet/minecraft/class_1834;field_8931:Fofficial jLcwk;j:F
-
enchantability
private final int enchantability- Mappings:
Namespace Name Mixin selector named enchantabilityLnet/minecraft/item/ToolMaterials;enchantability:Iintermediary field_8933Lnet/minecraft/class_1834;field_8933:Iofficial kLcwk;k:I
-
repairIngredient
- Mappings:
Namespace Name Mixin selector named repairIngredientLnet/minecraft/item/ToolMaterials;repairIngredient:Ljava/util/function/Supplier;intermediary field_8928Lnet/minecraft/class_1834;field_8928:Ljava/util/function/Supplier;official lLcwk;l:Ljava/util/function/Supplier;
-
-
Constructor Details
-
ToolMaterials
private ToolMaterials(TagKey<Block> inverseTag, int itemDurability, float miningSpeed, float attackDamage, int enchantability, Supplier<Ingredient> repairIngredient) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/item/ToolMaterials;<init>(Ljava/lang/String;ILnet/minecraft/registry/tag/TagKey;IFFILjava/util/function/Supplier;)Vintermediary <init>Lnet/minecraft/class_1834;<init>(Ljava/lang/String;ILnet/minecraft/class_6862;IFFILjava/util/function/Supplier;)Vofficial <init>Lcwk;<init>(Ljava/lang/String;ILawu;IFFILjava/util/function/Supplier;)V
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getDurability
public 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.- Specified by:
getDurabilityin interfaceToolMaterial- 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
public float getMiningSpeedMultiplier()Returns the mining speed bonus applied when aToolItemusing this material is breaking an appropriate block.1.0fwill result in no speed change.- Specified by:
getMiningSpeedMultiplierin interfaceToolMaterial- 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
public 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.- Specified by:
getAttackDamagein interfaceToolMaterial- 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
- Specified by:
getInverseTagin interfaceToolMaterial- 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
public 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.- Specified by:
getEnchantabilityin interfaceToolMaterial- 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
Returns theIngredientused to repair items using thisToolMaterial.By default,
ToolMaterialwill delegateItem.canRepair(ItemStack, ItemStack)back to this method.- Specified by:
getRepairIngredientin interfaceToolMaterial- 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;
-