Record Class ItemAttributeModifiers
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.ItemAttributeModifiers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DecimalFormatstatic final com.mojang.serialization.Codec<ItemAttributeModifiers> static final ItemAttributeModifiersprivate final List<ItemAttributeModifiers.Entry> The field for themodifiersrecord component.static final StreamCodec<RegistryFriendlyByteBuf, ItemAttributeModifiers> -
Constructor Summary
ConstructorsConstructorDescriptionItemAttributeModifiers(List<ItemAttributeModifiers.Entry> modifiers) Creates an instance of aItemAttributeModifiersrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()doublecompute(double pBaseValue, EquipmentSlot pEquipmentSlot) final booleanIndicates whether some other object is "equal to" this one.voidforEach(EquipmentSlotGroup pSlotGroup, BiConsumer<Holder<Attribute>, AttributeModifier> pAction) voidforEach(EquipmentSlotGroup pSlot, org.apache.commons.lang3.function.TriConsumer<Holder<Attribute>, AttributeModifier, ItemAttributeModifiers.Display> pAction) voidforEach(EquipmentSlot pEquipmentSlot, BiConsumer<Holder<Attribute>, AttributeModifier> pAction) 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.withModifierAdded(Holder<Attribute> pAttribute, AttributeModifier pModifier, EquipmentSlotGroup pSlot)
-
Field Details
-
modifiers
The field for themodifiersrecord component. -
EMPTY
-
CODEC
-
STREAM_CODEC
-
ATTRIBUTE_MODIFIER_FORMAT
-
-
Constructor Details
-
ItemAttributeModifiers
Creates an instance of aItemAttributeModifiersrecord class.- Parameters:
modifiers- the value for themodifiersrecord component
-
-
Method Details
-
builder
-
withModifierAdded
public ItemAttributeModifiers withModifierAdded(Holder<Attribute> pAttribute, AttributeModifier pModifier, EquipmentSlotGroup pSlot) -
forEach
public void forEach(EquipmentSlotGroup pSlot, org.apache.commons.lang3.function.TriConsumer<Holder<Attribute>, AttributeModifier, ItemAttributeModifiers.Display> pAction) -
forEach
public void forEach(EquipmentSlotGroup pSlotGroup, BiConsumer<Holder<Attribute>, AttributeModifier> pAction) -
forEach
public void forEach(EquipmentSlot pEquipmentSlot, BiConsumer<Holder<Attribute>, AttributeModifier> pAction) -
compute
-
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). -
modifiers
Returns the value of themodifiersrecord component.- Returns:
- the value of the
modifiersrecord component
-