Record Class ItemAttributeModifiers.Entry
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.ItemAttributeModifiers.Entry
- Enclosing class:
ItemAttributeModifiers
public static record ItemAttributeModifiers.Entry(Holder<Attribute> attribute, AttributeModifier modifier, EquipmentSlotGroup slot)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionThe field for theattribute
record component.static final com.mojang.serialization.Codec
<ItemAttributeModifiers.Entry> private final AttributeModifier
The field for themodifier
record component.private final EquipmentSlotGroup
The field for theslot
record component.static final StreamCodec
<RegistryFriendlyByteBuf, ItemAttributeModifiers.Entry> -
Constructor Summary
ConstructorDescriptionEntry
(Holder<Attribute> attribute, AttributeModifier modifier, EquipmentSlotGroup slot) Creates an instance of aEntry
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattribute
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.modifier()
Returns the value of themodifier
record component.slot()
Returns the value of theslot
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
attribute
The field for theattribute
record component. -
modifier
The field for themodifier
record component. -
slot
The field for theslot
record component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
Entry
Creates an instance of aEntry
record class.- Parameters:
attribute
- the value for theattribute
record componentmodifier
- the value for themodifier
record componentslot
- the value for theslot
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
attribute
Returns the value of theattribute
record component.- Returns:
- the value of the
attribute
record component
-
modifier
Returns the value of themodifier
record component.- Returns:
- the value of the
modifier
record component
-
slot
Returns the value of theslot
record component.- Returns:
- the value of the
slot
record component
-