Package org.quiltmc.qsl.tooltip.api
Interface ConvertibleTooltipData
- All Superinterfaces:
net.minecraft.client.item.TooltipData
public interface ConvertibleTooltipData
extends net.minecraft.client.item.TooltipData
Represents a
TooltipData which is convertible to a TooltipComponent on the client.
When converting a ConvertibleTooltipData to a TooltipComponent,
it will use the TooltipComponentCallback event with the phase
EVENT_PHASE.
WARNING: when implementing this interface,
make sure to annotate the implemented method toComponent() with @ClientOnly.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.util.IdentifierRepresents the event phasequilt_tooltip:convertible_tooltip_datawhich is used when converting this tooltip data to aTooltipComponent. -
Method Summary
Modifier and TypeMethodDescription@ClientOnly net.minecraft.client.gui.tooltip.TooltipComponentReturns the associated component.
-
Field Details
-
EVENT_PHASE
static final net.minecraft.util.Identifier EVENT_PHASERepresents the event phasequilt_tooltip:convertible_tooltip_datawhich is used when converting this tooltip data to aTooltipComponent. It runs after theEvent.DEFAULT_PHASEinTooltipComponentCallback, allowing listeners of the default phase of the event to override behavior from this interface if needed.
-
-
Method Details
-
toComponent
@ClientOnly @ClientOnly net.minecraft.client.gui.tooltip.TooltipComponent toComponent()Returns the associated component.WARNING: when implementing this interface, make sure to annotate the implemented method with
@ClientOnly.- Returns:
- the associated component
-