Record Class ItemLore
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.ItemLore
- All Implemented Interfaces:
TooltipProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ItemLore> static final ItemLoreThe field for thelinesrecord component.private static final Stylestatic final intstatic final StreamCodec<RegistryFriendlyByteBuf, ItemLore> The field for thestyledLinesrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToTooltip(Item.TooltipContext context, Consumer<Component> consumer, TooltipFlag flag, DataComponentGetter components) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.lines()Returns the value of thelinesrecord component.Returns the value of thestyledLinesrecord component.final StringtoString()Returns a string representation of this record class.withLineAdded(Component component)
-
Field Details
-
lines
-
styledLines
-
EMPTY
-
MAX_LINES
public static final int MAX_LINES- See Also:
-
LORE_STYLE
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
ItemLore
-
ItemLore
-
-
Method Details
-
withLineAdded
-
addToTooltip
public void addToTooltip(Item.TooltipContext context, Consumer<Component> consumer, TooltipFlag flag, DataComponentGetter components) - Specified by:
addToTooltipin interfaceTooltipProvider
-
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). -
lines
-
styledLines
-