Record Class ArmorMaterial
java.lang.Object
java.lang.Record
net.minecraft.world.item.equipment.ArmorMaterial
public record ArmorMaterial(int durability, Map<ArmorType,Integer> defense, int enchantmentValue, Holder<SoundEvent> equipSound, float toughness, float knockbackResistance, TagKey<Item> repairIngredient, ResourceKey<EquipmentAsset> assetId)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResourceKey<EquipmentAsset> The field for theassetIdrecord component.The field for thedefenserecord component.private final intThe field for thedurabilityrecord component.private final intThe field for theenchantmentValuerecord component.private final Holder<SoundEvent> The field for theequipSoundrecord component.private final floatThe field for theknockbackResistancerecord component.The field for therepairIngredientrecord component.private final floatThe field for thetoughnessrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionArmorMaterial(int durability, Map<ArmorType, Integer> defense, int enchantmentValue, Holder<SoundEvent> equipSound, float toughness, float knockbackResistance, TagKey<Item> repairIngredient, ResourceKey<EquipmentAsset> assetId) Creates an instance of aArmorMaterialrecord class. -
Method Summary
Modifier and TypeMethodDescriptionassetId()Returns the value of theassetIdrecord component.createAttributes(ArmorType pArmorType) defense()Returns the value of thedefenserecord component.intReturns the value of thedurabilityrecord component.intReturns the value of theenchantmentValuerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theequipSoundrecord component.final inthashCode()Returns a hash code value for this object.floatReturns the value of theknockbackResistancerecord component.Returns the value of therepairIngredientrecord component.final StringtoString()Returns a string representation of this record class.floatReturns the value of thetoughnessrecord component.
-
Field Details
-
durability
private final int durabilityThe field for thedurabilityrecord component. -
defense
The field for thedefenserecord component. -
enchantmentValue
private final int enchantmentValueThe field for theenchantmentValuerecord component. -
equipSound
The field for theequipSoundrecord component. -
toughness
private final float toughnessThe field for thetoughnessrecord component. -
knockbackResistance
private final float knockbackResistanceThe field for theknockbackResistancerecord component. -
repairIngredient
The field for therepairIngredientrecord component. -
assetId
The field for theassetIdrecord component.
-
-
Constructor Details
-
ArmorMaterial
public ArmorMaterial(int durability, Map<ArmorType, Integer> defense, int enchantmentValue, Holder<SoundEvent> equipSound, float toughness, float knockbackResistance, TagKey<Item> repairIngredient, ResourceKey<EquipmentAsset> assetId) Creates an instance of aArmorMaterialrecord class.- Parameters:
durability- the value for thedurabilityrecord componentdefense- the value for thedefenserecord componentenchantmentValue- the value for theenchantmentValuerecord componentequipSound- the value for theequipSoundrecord componenttoughness- the value for thetoughnessrecord componentknockbackResistance- the value for theknockbackResistancerecord componentrepairIngredient- the value for therepairIngredientrecord componentassetId- the value for theassetIdrecord component
-
-
Method Details
-
createAttributes
-
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 '=='. -
durability
public int durability()Returns the value of thedurabilityrecord component.- Returns:
- the value of the
durabilityrecord component
-
defense
Returns the value of thedefenserecord component.- Returns:
- the value of the
defenserecord component
-
enchantmentValue
public int enchantmentValue()Returns the value of theenchantmentValuerecord component.- Returns:
- the value of the
enchantmentValuerecord component
-
equipSound
Returns the value of theequipSoundrecord component.- Returns:
- the value of the
equipSoundrecord component
-
toughness
public float toughness()Returns the value of thetoughnessrecord component.- Returns:
- the value of the
toughnessrecord component
-
knockbackResistance
public float knockbackResistance()Returns the value of theknockbackResistancerecord component.- Returns:
- the value of the
knockbackResistancerecord component
-
repairIngredient
Returns the value of therepairIngredientrecord component.- Returns:
- the value of the
repairIngredientrecord component
-
assetId
Returns the value of theassetIdrecord component.- Returns:
- the value of the
assetIdrecord component
-