Interface ClientTooltipComponentCallback
public interface ClientTooltipComponentCallback
Allows registering a mapping from
TooltipComponent to ClientTooltipComponent.
This allows custom tooltips for items: first, override Item.getTooltipImage(ItemStack) and return a custom TooltipComponent.
Second, register a listener to this event and convert the component to your client component implementation if it's an instance of your component class.
Note that failure to map some components to a client component will throw an exception,
so make sure that any components you return in Item.getTooltipImage(ItemStack) will be handled by one of the callbacks.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponentgetClientComponent(net.minecraft.world.inventory.tooltip.TooltipComponent component) Return the client tooltip component for the passed tooltip component, or null if none is available.
-
Field Details
-
EVENT
-
-
Method Details
-
getClientComponent
@Nullable net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent getClientComponent(net.minecraft.world.inventory.tooltip.TooltipComponent component) Return the client tooltip component for the passed tooltip component, or null if none is available.
-