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 theattribute
record component.private final double
The field for thebaseValue
record 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 themodifiers
record component. -
Constructor Summary
ConstructorsConstructorDescriptionPacked
(Holder<Attribute> attribute, double baseValue, List<AttributeModifier> modifiers) Creates an instance of aPacked
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattribute
record component.double
Returns the value of thebaseValue
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of themodifiers
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
attribute
The field for theattribute
record component. -
baseValue
private final double baseValueThe field for thebaseValue
record component. -
modifiers
The field for themodifiers
record component. -
CODEC
-
LIST_CODEC
-
-
Constructor Details
-
Packed
Creates an instance of aPacked
record class.- Parameters:
attribute
- the value for theattribute
record componentbaseValue
- the value for thebaseValue
record componentmodifiers
- the value for themodifiers
record component
-
-
Method Details
-
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 '=='. -
attribute
Returns the value of theattribute
record component.- Returns:
- the value of the
attribute
record component
-
baseValue
public double baseValue()Returns the value of thebaseValue
record component.- Returns:
- the value of the
baseValue
record component
-
modifiers
Returns the value of themodifiers
record component.- Returns:
- the value of the
modifiers
record component
-