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 cnzintermediary net/minecraft/class_1741named net/minecraft/item/ArmorMaterialofficial bintermediary comp_2298named defenseofficial cintermediary comp_2299named getEnchantabilityofficial dintermediary comp_2300named getEquipSoundofficial eintermediary comp_2301named getRepairIngredientofficial fintermediary comp_2302named layersofficial gintermediary comp_2303named getToughnessofficial hintermediary comp_2304named 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 thedefenserecord component.private final intThe field for thegetEnchantabilityrecord component.private final RegistryEntry<SoundEvent> The field for thegetEquipSoundrecord component.private final floatThe field for thegetKnockbackResistancerecord component.private final Supplier<Ingredient> The field for thegetRepairIngredientrecord component.private final floatThe field for thegetToughnessrecord component.private final List<ArmorMaterial.Layer> The field for thelayersrecord 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 thedefenserecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the base enchantment value used byArmorItemwith this material.Returns the value of thegetEquipSoundrecord component.floatReturns the knockback resistance value of anArmorItempiece using thisArmorMaterial.intgetProtection(ArmorItem.Type type) Returns the amount of armor protection points offered by anArmorItemusing thisArmorMaterialwhile it is worn by a player.Returns theIngredientused to repair items using thisArmorMaterial.floatReturns the toughness value of anArmorItempiece using thisArmorMaterial.final inthashCode()Returns a hash code value for this object.layers()Returns the value of thelayersrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
defense
The field for thedefenserecord component. -
getEnchantability
private final int getEnchantabilityThe field for thegetEnchantabilityrecord component. -
getEquipSound
The field for thegetEquipSoundrecord component. -
getRepairIngredient
The field for thegetRepairIngredientrecord component. -
layers
The field for thelayersrecord component. -
getToughness
private final float getToughnessThe field for thegetToughnessrecord component. -
getKnockbackResistance
private final float getKnockbackResistanceThe field for thegetKnockbackResistancerecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector official aLcnz;a:Lcom/mojang/serialization/Codec;intermediary field_48840Lnet/minecraft/class_1741;field_48840:Lcom/mojang/serialization/Codec;named CODECLnet/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 anArmorItemusing thisArmorMaterialwhile it is worn by a player.The protection value returned here is applied as an
EntityAttributeModifierto a player wearing theArmorItempiece via theEntityAttributeModifier.Operation.ADDITIONmodifier.- Parameters:
type- theArmorItem.Typeof theItemwith thisArmorMaterial- Returns:
- the amount of armor protection points offered by an
ArmorItemwith thisArmorMaterial - Mappings:
Namespace Name Mixin selector official aLcnz;a(Lcny$a;)Iintermediary method_48403Lnet/minecraft/class_1741;method_48403(Lnet/minecraft/class_1738$class_8051;)Inamed getProtectionLnet/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 thedefenserecord component.- Returns:
- the value of the
defenserecord component
-
getEnchantability
public int getEnchantability()Returns the base enchantment value used byArmorItemwith this material.By default,
ArmorItemwill 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 bLcnz;b()Iintermediary comp_2299Lnet/minecraft/class_1741;comp_2299()Inamed getEnchantabilityLnet/minecraft/item/ArmorMaterial;getEnchantability()I
-
getEquipSound
Returns the value of thegetEquipSoundrecord component.- Returns:
- the value of the
getEquipSoundrecord component
-
getRepairIngredient
Returns theIngredientused to repair items using thisArmorMaterial.By default,
ArmorItemwill delegateItem.canRepair(ItemStack, ItemStack)back to this method.- Returns:
- the
Ingredientrequired to repair items with thisArmorMaterial - Mappings:
Namespace Name Mixin selector official dLcnz;d()Ljava/util/function/Supplier;intermediary comp_2301Lnet/minecraft/class_1741;comp_2301()Ljava/util/function/Supplier;named getRepairIngredientLnet/minecraft/item/ArmorMaterial;getRepairIngredient()Ljava/util/function/Supplier;
-
layers
Returns the value of thelayersrecord component.- Returns:
- the value of the
layersrecord component
-
getToughness
public float getToughness()Returns the toughness value of anArmorItempiece using thisArmorMaterial.ArmorItemwill cover the value returned here into theEntityAttributes.GENERIC_ARMOR_TOUGHNESSstatistic with theEntityAttributeModifier.Operation.ADDITIONmodifier type.- Returns:
- the toughness value of any
ArmorItemusing thisArmorMaterial - Mappings:
Namespace Name Mixin selector official fLcnz;f()Fintermediary comp_2303Lnet/minecraft/class_1741;comp_2303()Fnamed getToughnessLnet/minecraft/item/ArmorMaterial;getToughness()F
-
getKnockbackResistance
public float getKnockbackResistance()Returns the knockback resistance value of anArmorItempiece using thisArmorMaterial.ArmorItemwill cover the value returned here into theEntityAttributes.GENERIC_KNOCKBACK_RESISTANCEstatistic with theEntityAttributeModifier.Operation.ADDITIONmodifier type.- Returns:
- the knockback resistance value of an
ArmorItempiece using thisArmorMaterial - Mappings:
Namespace Name Mixin selector official gLcnz;g()Fintermediary comp_2304Lnet/minecraft/class_1741;comp_2304()Fnamed getKnockbackResistanceLnet/minecraft/item/ArmorMaterial;getKnockbackResistance()F
-