Record Class ItemAttributeModifiers.Display.OverrideText
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.ItemAttributeModifiers.Display.OverrideText
- All Implemented Interfaces:
ItemAttributeModifiers.Display
- Enclosing interface:
ItemAttributeModifiers.Display
public static record ItemAttributeModifiers.Display.OverrideText(Component component)
extends Record
implements ItemAttributeModifiers.Display
-
Nested Class Summary
Nested classes/interfaces inherited from interface ItemAttributeModifiers.Display
ItemAttributeModifiers.Display.Default, ItemAttributeModifiers.Display.Hidden, ItemAttributeModifiers.Display.OverrideText, ItemAttributeModifiers.Display.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.serialization.MapCodec<ItemAttributeModifiers.Display.OverrideText> private final ComponentThe field for thecomponentrecord component.private static final StreamCodec<RegistryFriendlyByteBuf, ItemAttributeModifiers.Display.OverrideText> -
Constructor Summary
ConstructorsConstructorDescriptionOverrideText(Component component) Creates an instance of aOverrideTextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(Consumer<Component> consumer, @Nullable Player player, Holder<Attribute> attribute, AttributeModifier modifier) Returns the value of thecomponentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()
-
Field Details
-
component
The field for thecomponentrecord component. -
CODEC
private static final com.mojang.serialization.MapCodec<ItemAttributeModifiers.Display.OverrideText> CODEC -
STREAM_CODEC
private static final StreamCodec<RegistryFriendlyByteBuf, ItemAttributeModifiers.Display.OverrideText> STREAM_CODEC
-
-
Constructor Details
-
OverrideText
Creates an instance of aOverrideTextrecord class.- Parameters:
component- the value for thecomponentrecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceItemAttributeModifiers.Display
-
apply
public void apply(Consumer<Component> consumer, @Nullable Player player, Holder<Attribute> attribute, AttributeModifier modifier) - Specified by:
applyin interfaceItemAttributeModifiers.Display
-
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). -
component
Returns the value of thecomponentrecord component.- Returns:
- the value of the
componentrecord component
-