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(Holder<Attribute> attribute, double baseValue, EquipmentSlot slot) final booleanIndicates whether some other object is "equal to" this one.voidforEach(EquipmentSlotGroup slot, BiConsumer<Holder<Attribute>, AttributeModifier> consumer) voidforEach(EquipmentSlotGroup slot, org.apache.commons.lang3.function.TriConsumer<Holder<Attribute>, AttributeModifier, ItemAttributeModifiers.Display> consumer) voidforEach(EquipmentSlot slot, BiConsumer<Holder<Attribute>, AttributeModifier> consumer) 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> attribute, AttributeModifier modifier, EquipmentSlotGroup slot)
-
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> attribute, AttributeModifier modifier, EquipmentSlotGroup slot) -
forEach
public void forEach(EquipmentSlotGroup slot, org.apache.commons.lang3.function.TriConsumer<Holder<Attribute>, AttributeModifier, ItemAttributeModifiers.Display> consumer) -
forEach
public void forEach(EquipmentSlotGroup slot, BiConsumer<Holder<Attribute>, AttributeModifier> consumer) -
forEach
-
compute
-
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. 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
-