Record Class Unbreakable
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.Unbreakable
- All Implemented Interfaces:
TooltipProvider
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<Unbreakable> private final boolean
The field for theshowInTooltip
record component.static final StreamCodec
<io.netty.buffer.ByteBuf, Unbreakable> private static final Component
-
Constructor Summary
ConstructorDescriptionUnbreakable
(boolean showInTooltip) Creates an instance of aUnbreakable
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToTooltip
(Item.TooltipContext p_331499_, Consumer<Component> p_335134_, TooltipFlag p_331046_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of theshowInTooltip
record component.final String
toString()
Returns a string representation of this record class.withTooltip
(boolean p_334168_)
-
Field Details
-
showInTooltip
private final boolean showInTooltipThe field for theshowInTooltip
record component. -
CODEC
-
STREAM_CODEC
-
TOOLTIP
-
-
Constructor Details
-
Unbreakable
public Unbreakable(boolean showInTooltip) Creates an instance of aUnbreakable
record class.- Parameters:
showInTooltip
- the value for theshowInTooltip
record component
-
-
Method Details
-
addToTooltip
public void addToTooltip(Item.TooltipContext p_331499_, Consumer<Component> p_335134_, TooltipFlag p_331046_) - Specified by:
addToTooltip
in interfaceTooltipProvider
-
withTooltip
-
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 with '=='. -
showInTooltip
public boolean showInTooltip()Returns the value of theshowInTooltip
record component.- Returns:
- the value of the
showInTooltip
record component
-