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 net.minecraft.world.item.component.ItemAttributeModifiers.Display
ItemAttributeModifiers.Display.Default, ItemAttributeModifiers.Display.Hidden, ItemAttributeModifiers.Display.OverrideText, ItemAttributeModifiers.Display.Type
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final com.mojang.serialization.MapCodec
<ItemAttributeModifiers.Display.OverrideText> private final Component
The field for thecomponent
record component.(package private) static final StreamCodec
<RegistryFriendlyByteBuf, ItemAttributeModifiers.Display.OverrideText> -
Constructor Summary
ConstructorsConstructorDescriptionOverrideText
(Component component) Creates an instance of aOverrideText
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(Consumer<Component> pOutput, Player pPlayer, Holder<Attribute> pAttribute, AttributeModifier pModifier) Returns the value of thecomponent
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.type()
-
Field Details
-
component
The field for thecomponent
record component. -
CODEC
-
STREAM_CODEC
static final StreamCodec<RegistryFriendlyByteBuf,ItemAttributeModifiers.Display.OverrideText> STREAM_CODEC
-
-
Constructor Details
-
OverrideText
Creates an instance of aOverrideText
record class.- Parameters:
component
- the value for thecomponent
record component
-
-
Method Details
-
type
- Specified by:
type
in interfaceItemAttributeModifiers.Display
-
apply
public void apply(Consumer<Component> pOutput, @Nullable Player pPlayer, Holder<Attribute> pAttribute, AttributeModifier pModifier) - Specified by:
apply
in interfaceItemAttributeModifiers.Display
-
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)
. -
component
Returns the value of thecomponent
record component.- Returns:
- the value of the
component
record component
-