Package net.minecraft.item
Record Class ArmorMaterial
java.lang.Object
java.lang.Record
net.minecraft.item.ArmorMaterial
- Record Components:
defense
-enchantability
-equipSound
-repairIngredient
-layers
-toughness
-knockbackResistance
-
public record ArmorMaterial(Map<ArmorItem.Type,Integer> defense, int enchantability, RegistryEntry<SoundEvent> equipSound, Supplier<Ingredient> repairIngredient, List<ArmorMaterial.Layer> layers, float toughness, float knockbackResistance)
extends Record
Defines the material stats of an
ArmorItem
item.
To view available vanilla armor materials, visit ArmorMaterials
.
- Mappings:
Namespace Name named net/minecraft/item/ArmorMaterial
intermediary net/minecraft/class_1741
official csh
named defense
intermediary comp_2298
official b
named enchantability
intermediary comp_2299
official c
named equipSound
intermediary comp_2300
official d
named repairIngredient
intermediary comp_2301
official e
named layers
intermediary comp_2302
official f
named toughness
intermediary comp_2303
official g
named knockbackResistance
intermediary comp_2304
official h
-
Nested Class Summary
-
Field Summary
Modifier 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 theenchantability
record component.private final RegistryEntry
<SoundEvent> The field for theequipSound
record component.private final float
The field for theknockbackResistance
record component.private final List
<ArmorMaterial.Layer> The field for thelayers
record component.private final Supplier
<Ingredient> The field for therepairIngredient
record component.private final float
The field for thetoughness
record component. -
Constructor Summary
ConstructorDescriptionArmorMaterial
(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.int
Returns the value of theenchantability
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of theequipSound
record component.int
getProtection
(ArmorItem.Type type) Returns the amount of armor protection points offered by anArmorItem
using thisArmorMaterial
while it is worn by a player.final int
hashCode()
Returns a hash code value for this object.float
Returns the value of theknockbackResistance
record component.layers()
Returns the value of thelayers
record component.Returns the value of therepairIngredient
record component.final String
toString()
Returns a string representation of this record class.float
Returns the value of thetoughness
record component.
-
Field Details
-
defense
The field for thedefense
record component. -
enchantability
private final int enchantabilityThe field for theenchantability
record component. -
equipSound
The field for theequipSound
record component. -
repairIngredient
The field for therepairIngredient
record component. -
layers
The field for thelayers
record component. -
toughness
private final float toughnessThe field for thetoughness
record component. -
knockbackResistance
private final float knockbackResistanceThe field for theknockbackResistance
record component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/item/ArmorMaterial;CODEC:Lcom/mojang/serialization/Codec;
intermediary field_48840
Lnet/minecraft/class_1741;field_48840:Lcom/mojang/serialization/Codec;
official a
Lcsh;a: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.ADD_VALUE
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 named getProtection
Lnet/minecraft/item/ArmorMaterial;getProtection(Lnet/minecraft/item/ArmorItem$Type;)I
intermediary method_48403
Lnet/minecraft/class_1741;method_48403(Lnet/minecraft/class_1738$class_8051;)I
official a
Lcsh;a(Lcsg$a;)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
-
enchantability
public int enchantability()Returns the value of theenchantability
record component.- Returns:
- the value of the
enchantability
record component
-
equipSound
Returns the value of theequipSound
record component.- Returns:
- the value of the
equipSound
record component
-
repairIngredient
Returns the value of therepairIngredient
record component.- Returns:
- the value of the
repairIngredient
record component
-
layers
Returns the value of thelayers
record component.- Returns:
- the value of the
layers
record component
-
toughness
public float toughness()Returns the value of thetoughness
record component.- Returns:
- the value of the
toughness
record component
-
knockbackResistance
public float knockbackResistance()Returns the value of theknockbackResistance
record component.- Returns:
- the value of the
knockbackResistance
record component
-