Record Class ItemAttributeModifiers
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.ItemAttributeModifiers
public record ItemAttributeModifiers(List<ItemAttributeModifiers.Entry> modifiers, boolean showInTooltip)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DecimalFormatstatic final com.mojang.serialization.Codec<ItemAttributeModifiers> static final ItemAttributeModifiersprivate static final com.mojang.serialization.Codec<ItemAttributeModifiers> private final List<ItemAttributeModifiers.Entry> The field for themodifiersrecord component.private final booleanThe field for theshowInTooltiprecord component.static final StreamCodec<RegistryFriendlyByteBuf, ItemAttributeModifiers> -
Constructor Summary
ConstructorsConstructorDescriptionItemAttributeModifiers(List<ItemAttributeModifiers.Entry> modifiers, boolean showInTooltip) Creates an instance of aItemAttributeModifiersrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()doublecompute(double p_330928_, EquipmentSlot p_330945_) final booleanIndicates whether some other object is "equal to" this one.voidforEach(EquipmentSlot p_332158_, BiConsumer<Holder<Attribute>, AttributeModifier> p_331684_) final inthashCode()Returns a hash code value for this object.Returns the value of themodifiersrecord component.booleanReturns the value of theshowInTooltiprecord component.final StringtoString()Returns a string representation of this record class.withModifierAdded(Holder<Attribute> p_330266_, AttributeModifier p_331954_, EquipmentSlotGroup p_332175_) withTooltip(boolean p_335777_)
-
Field Details
-
modifiers
The field for themodifiersrecord component. -
showInTooltip
private final boolean showInTooltipThe field for theshowInTooltiprecord component. -
EMPTY
-
FULL_CODEC
-
CODEC
-
STREAM_CODEC
-
ATTRIBUTE_MODIFIER_FORMAT
-
-
Constructor Details
-
ItemAttributeModifiers
Creates an instance of aItemAttributeModifiersrecord class.- Parameters:
modifiers- the value for themodifiersrecord componentshowInTooltip- the value for theshowInTooltiprecord component
-
-
Method Details
-
withTooltip
-
builder
-
withModifierAdded
public ItemAttributeModifiers withModifierAdded(Holder<Attribute> p_330266_, AttributeModifier p_331954_, EquipmentSlotGroup p_332175_) -
forEach
public void forEach(EquipmentSlot p_332158_, BiConsumer<Holder<Attribute>, AttributeModifier> p_331684_) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
modifiers
Returns the value of themodifiersrecord component.- Returns:
- the value of the
modifiersrecord component
-
showInTooltip
public boolean showInTooltip()Returns the value of theshowInTooltiprecord component.- Returns:
- the value of the
showInTooltiprecord component
-