Record Class ArmorMaterial
- Record Components:
defense
-getEnchantability
-getEquipSound
-getRepairIngredient
-layers
-getToughness
-getKnockbackResistance
-
ArmorItem
item.
To view available vanilla armor materials, visit ArmorMaterials
.
- Mappings:
Namespace Name official cnz
intermediary net/minecraft/class_1741
named net/minecraft/item/ArmorMaterial
official b
intermediary comp_2298
named defense
official c
intermediary comp_2299
named getEnchantability
official d
intermediary comp_2300
named getEquipSound
official e
intermediary comp_2301
named getRepairIngredient
official f
intermediary comp_2302
named layers
official g
intermediary comp_2303
named getToughness
official h
intermediary comp_2304
named getKnockbackResistance
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<RegistryEntry<ArmorMaterial>> private final Map
<ArmorItem.Type, Integer> The field for thedefense
record component.private final int
The field for thegetEnchantability
record component.private final RegistryEntry
<SoundEvent> The field for thegetEquipSound
record component.private final float
The field for thegetKnockbackResistance
record component.private final Supplier
<Ingredient> The field for thegetRepairIngredient
record component.private final float
The field for thegetToughness
record component.private final List
<ArmorMaterial.Layer> The field for thelayers
record component. -
Constructor Summary
ConstructorsConstructorDescriptionArmorMaterial
(Map<ArmorItem.Type, Integer> map, int int2, RegistryEntry<SoundEvent> registryEntry, Supplier<Ingredient> supplier, List<ArmorMaterial.Layer> list, float float2, float float3) -
Method Summary
Modifier and TypeMethodDescriptiondefense()
Returns the value of thedefense
record component.final boolean
Indicates whether some other object is "equal to" this one.int
Returns the base enchantment value used byArmorItem
with this material.Returns the value of thegetEquipSound
record component.float
Returns the knockback resistance value of anArmorItem
piece using thisArmorMaterial
.int
getProtection
(ArmorItem.Type type) Returns the amount of armor protection points offered by anArmorItem
using thisArmorMaterial
while it is worn by a player.Returns theIngredient
used to repair items using thisArmorMaterial
.float
Returns the toughness value of anArmorItem
piece using thisArmorMaterial
.final int
hashCode()
Returns a hash code value for this object.layers()
Returns the value of thelayers
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
defense
The field for thedefense
record component. -
getEnchantability
private final int getEnchantabilityThe field for thegetEnchantability
record component. -
getEquipSound
The field for thegetEquipSound
record component. -
getRepairIngredient
The field for thegetRepairIngredient
record component. -
layers
The field for thelayers
record component. -
getToughness
private final float getToughnessThe field for thegetToughness
record component. -
getKnockbackResistance
private final float getKnockbackResistanceThe field for thegetKnockbackResistance
record component. -
CODEC
- Mappings:
Namespace Name Mixin selector official a
Lcnz;a:Lcom/mojang/serialization/Codec;
intermediary field_48840
Lnet/minecraft/class_1741;field_48840:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/item/ArmorMaterial;CODEC:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
ArmorMaterial
public ArmorMaterial(Map<ArmorItem.Type, Integer> map, int int2, RegistryEntry<SoundEvent> registryEntry, Supplier<Ingredient> supplier, List<ArmorMaterial.Layer> list, float float2, float float3)
-
-
Method Details
-
getProtection
Returns the amount of armor protection points offered by anArmorItem
using thisArmorMaterial
while it is worn by a player.The protection value returned here is applied as an
EntityAttributeModifier
to a player wearing theArmorItem
piece via theEntityAttributeModifier.Operation.ADDITION
modifier.- Parameters:
type
- theArmorItem.Type
of theItem
with thisArmorMaterial
- Returns:
- the amount of armor protection points offered by an
ArmorItem
with thisArmorMaterial
- Mappings:
Namespace Name Mixin selector official a
Lcnz;a(Lcny$a;)I
intermediary method_48403
Lnet/minecraft/class_1741;method_48403(Lnet/minecraft/class_1738$class_8051;)I
named getProtection
Lnet/minecraft/item/ArmorMaterial;getProtection(Lnet/minecraft/item/ArmorItem$Type;)I
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
defense
Returns the value of thedefense
record component.- Returns:
- the value of the
defense
record component
-
getEnchantability
public int getEnchantability()Returns the base enchantment value used byArmorItem
with this material.By default,
ArmorItem
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 armor using this material - Mappings:
Namespace Name Mixin selector official b
Lcnz;b()I
intermediary comp_2299
Lnet/minecraft/class_1741;comp_2299()I
named getEnchantability
Lnet/minecraft/item/ArmorMaterial;getEnchantability()I
-
getEquipSound
Returns the value of thegetEquipSound
record component.- Returns:
- the value of the
getEquipSound
record component
-
getRepairIngredient
Returns theIngredient
used to repair items using thisArmorMaterial
.By default,
ArmorItem
will delegateItem.canRepair(ItemStack, ItemStack)
back to this method.- Returns:
- the
Ingredient
required to repair items with thisArmorMaterial
- Mappings:
Namespace Name Mixin selector official d
Lcnz;d()Ljava/util/function/Supplier;
intermediary comp_2301
Lnet/minecraft/class_1741;comp_2301()Ljava/util/function/Supplier;
named getRepairIngredient
Lnet/minecraft/item/ArmorMaterial;getRepairIngredient()Ljava/util/function/Supplier;
-
layers
Returns the value of thelayers
record component.- Returns:
- the value of the
layers
record component
-
getToughness
public float getToughness()Returns the toughness value of anArmorItem
piece using thisArmorMaterial
.ArmorItem
will cover the value returned here into theEntityAttributes.GENERIC_ARMOR_TOUGHNESS
statistic with theEntityAttributeModifier.Operation.ADDITION
modifier type.- Returns:
- the toughness value of any
ArmorItem
using thisArmorMaterial
- Mappings:
Namespace Name Mixin selector official f
Lcnz;f()F
intermediary comp_2303
Lnet/minecraft/class_1741;comp_2303()F
named getToughness
Lnet/minecraft/item/ArmorMaterial;getToughness()F
-
getKnockbackResistance
public float getKnockbackResistance()Returns the knockback resistance value of anArmorItem
piece using thisArmorMaterial
.ArmorItem
will cover the value returned here into theEntityAttributes.GENERIC_KNOCKBACK_RESISTANCE
statistic with theEntityAttributeModifier.Operation.ADDITION
modifier type.- Returns:
- the knockback resistance value of an
ArmorItem
piece using thisArmorMaterial
- Mappings:
Namespace Name Mixin selector official g
Lcnz;g()F
intermediary comp_2304
Lnet/minecraft/class_1741;comp_2304()F
named getKnockbackResistance
Lnet/minecraft/item/ArmorMaterial;getKnockbackResistance()F
-