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, ItemAttributeModifiers.Display display)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theattributerecord component.static final com.mojang.serialization.Codec<ItemAttributeModifiers.Entry> private final ItemAttributeModifiers.DisplayThe field for thedisplayrecord component.private final AttributeModifierThe field for themodifierrecord component.private final EquipmentSlotGroupThe field for theslotrecord component.static final StreamCodec<RegistryFriendlyByteBuf, ItemAttributeModifiers.Entry> -
Constructor Summary
ConstructorsConstructorDescriptionEntry(Holder<Attribute> p_330366_, AttributeModifier p_332188_, EquipmentSlotGroup p_331685_) Entry(Holder<Attribute> attribute, AttributeModifier modifier, EquipmentSlotGroup slot, ItemAttributeModifiers.Display display) Creates an instance of aEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributerecord component.display()Returns the value of thedisplayrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(Holder<Attribute> pAttribute, Identifier pId) modifier()Returns the value of themodifierrecord component.slot()Returns the value of theslotrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
attribute
The field for theattributerecord component. -
modifier
The field for themodifierrecord component. -
slot
The field for theslotrecord component. -
display
The field for thedisplayrecord component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
Entry
public Entry(Holder<Attribute> p_330366_, AttributeModifier p_332188_, EquipmentSlotGroup p_331685_) -
Entry
public Entry(Holder<Attribute> attribute, AttributeModifier modifier, EquipmentSlotGroup slot, ItemAttributeModifiers.Display display) Creates an instance of aEntryrecord class.- Parameters:
attribute- the value for theattributerecord componentmodifier- the value for themodifierrecord componentslot- the value for theslotrecord componentdisplay- the value for thedisplayrecord component
-
-
Method Details
-
matches
-
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 theattributerecord component.- Returns:
- the value of the
attributerecord component
-
modifier
Returns the value of themodifierrecord component.- Returns:
- the value of the
modifierrecord component
-
slot
Returns the value of theslotrecord component.- Returns:
- the value of the
slotrecord component
-
display
Returns the value of thedisplayrecord component.- Returns:
- the value of the
displayrecord component
-