Package net.minecraft.item
Enum Class ToolMaterials
- All Implemented Interfaces:
Serializable
,Comparable<ToolMaterials>
,Constable
,ToolMaterial
Provides the default
ToolMaterial
s used by vanilla tools.- Mappings:
Namespace Name named net/minecraft/item/ToolMaterials
intermediary net/minecraft/class_1834
official cwi
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final float
private final int
private final int
private final float
private final Supplier
<Ingredient> -
Constructor Summary
ModifierConstructorDescriptionprivate
ToolMaterials
(TagKey<Block> inverseTag, int itemDurability, float miningSpeed, float attackDamage, int enchantability, Supplier<Ingredient> repairIngredient) -
Method Summary
Modifier and TypeMethodDescriptionfloat
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
.static ToolMaterials
Returns 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, valueOf
Methods inherited from interface net.minecraft.item.ToolMaterial
createComponent
-
Enum Constant Details
-
WOOD
- Mappings:
Namespace Name Mixin selector named WOOD
Lnet/minecraft/item/ToolMaterials;WOOD:Lnet/minecraft/item/ToolMaterials;
intermediary field_8922
Lnet/minecraft/class_1834;field_8922:Lnet/minecraft/class_1834;
official a
Lcwi;a:Lcwi;
-
STONE
- Mappings:
Namespace Name Mixin selector named STONE
Lnet/minecraft/item/ToolMaterials;STONE:Lnet/minecraft/item/ToolMaterials;
intermediary field_8927
Lnet/minecraft/class_1834;field_8927:Lnet/minecraft/class_1834;
official b
Lcwi;b:Lcwi;
-
IRON
- Mappings:
Namespace Name Mixin selector named IRON
Lnet/minecraft/item/ToolMaterials;IRON:Lnet/minecraft/item/ToolMaterials;
intermediary field_8923
Lnet/minecraft/class_1834;field_8923:Lnet/minecraft/class_1834;
official c
Lcwi;c:Lcwi;
-
DIAMOND
- Mappings:
Namespace Name Mixin selector named DIAMOND
Lnet/minecraft/item/ToolMaterials;DIAMOND:Lnet/minecraft/item/ToolMaterials;
intermediary field_8930
Lnet/minecraft/class_1834;field_8930:Lnet/minecraft/class_1834;
official d
Lcwi;d:Lcwi;
-
GOLD
- Mappings:
Namespace Name Mixin selector named GOLD
Lnet/minecraft/item/ToolMaterials;GOLD:Lnet/minecraft/item/ToolMaterials;
intermediary field_8929
Lnet/minecraft/class_1834;field_8929:Lnet/minecraft/class_1834;
official e
Lcwi;e:Lcwi;
-
NETHERITE
- Mappings:
Namespace Name Mixin selector named NETHERITE
Lnet/minecraft/item/ToolMaterials;NETHERITE:Lnet/minecraft/item/ToolMaterials;
intermediary field_22033
Lnet/minecraft/class_1834;field_22033:Lnet/minecraft/class_1834;
official f
Lcwi;f:Lcwi;
-
-
Field Details
-
inverseTag
- Mappings:
Namespace Name Mixin selector named inverseTag
Lnet/minecraft/item/ToolMaterials;inverseTag:Lnet/minecraft/registry/tag/TagKey;
intermediary field_50006
Lnet/minecraft/class_1834;field_50006:Lnet/minecraft/class_6862;
official g
Lcwi;g:Laxf;
-
itemDurability
private final int itemDurability- Mappings:
Namespace Name Mixin selector named itemDurability
Lnet/minecraft/item/ToolMaterials;itemDurability:I
intermediary field_8924
Lnet/minecraft/class_1834;field_8924:I
official h
Lcwi;h:I
-
miningSpeed
private final float miningSpeed- Mappings:
Namespace Name Mixin selector named miningSpeed
Lnet/minecraft/item/ToolMaterials;miningSpeed:F
intermediary field_8932
Lnet/minecraft/class_1834;field_8932:F
official i
Lcwi;i:F
-
attackDamage
private final float attackDamage- Mappings:
Namespace Name Mixin selector named attackDamage
Lnet/minecraft/item/ToolMaterials;attackDamage:F
intermediary field_8931
Lnet/minecraft/class_1834;field_8931:F
official j
Lcwi;j:F
-
enchantability
private final int enchantability- Mappings:
Namespace Name Mixin selector named enchantability
Lnet/minecraft/item/ToolMaterials;enchantability:I
intermediary field_8933
Lnet/minecraft/class_1834;field_8933:I
official k
Lcwi;k:I
-
repairIngredient
- Mappings:
Namespace Name Mixin selector named repairIngredient
Lnet/minecraft/item/ToolMaterials;repairIngredient:Ljava/util/function/Supplier;
intermediary field_8928
Lnet/minecraft/class_1834;field_8928:Ljava/util/function/Supplier;
official l
Lcwi;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;)V
intermediary <init>
Lnet/minecraft/class_1834;<init>(Ljava/lang/String;ILnet/minecraft/class_6862;IFFILjava/util/function/Supplier;)V
official <init>
Lcwi;<init>(Ljava/lang/String;ILaxf;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 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.- Specified by:
getDurability
in interfaceToolMaterial
- 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
public 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.- Specified by:
getMiningSpeedMultiplier
in interfaceToolMaterial
- 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
public 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.- Specified by:
getAttackDamage
in interfaceToolMaterial
- 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
- Specified by:
getInverseTag
in interfaceToolMaterial
- 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
public 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
.- Specified by:
getEnchantability
in interfaceToolMaterial
- 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
Returns theIngredient
used to repair items using thisToolMaterial
.By default,
ToolMaterial
will delegateItem.canRepair(ItemStack, ItemStack)
back to this method.- Specified by:
getRepairIngredient
in interfaceToolMaterial
- 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;
-