Record Class AttributeInstance.Packed
java.lang.Object
java.lang.Record
net.minecraft.world.entity.ai.attributes.AttributeInstance.Packed
- Enclosing class:
AttributeInstance
public static record AttributeInstance.Packed(Holder<Attribute> attribute, double baseValue, List<AttributeModifier> modifiers)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theattributerecord component.private final doubleThe field for thebaseValuerecord component.static final com.mojang.serialization.Codec<AttributeInstance.Packed> static final com.mojang.serialization.Codec<List<AttributeInstance.Packed>> private final List<AttributeModifier> The field for themodifiersrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPacked(Holder<Attribute> attribute, double baseValue, List<AttributeModifier> modifiers) Creates an instance of aPackedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributerecord component.doubleReturns the value of thebaseValuerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themodifiersrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
attribute
-
baseValue
private final double baseValueThe field for thebaseValuerecord component. -
modifiers
The field for themodifiersrecord component. -
CODEC
-
LIST_CODEC
-
-
Constructor Details
-
Packed
Creates an instance of aPackedrecord class.- Parameters:
attribute- the value for theattributerecord componentbaseValue- the value for thebaseValuerecord componentmodifiers- the value for themodifiersrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
attribute
-
baseValue
public double baseValue()Returns the value of thebaseValuerecord component.- Returns:
- the value of the
baseValuerecord component
-
modifiers
Returns the value of themodifiersrecord component.- Returns:
- the value of the
modifiersrecord component
-