Interface TooltipComponentCallback


@Environment(CLIENT) public interface TooltipComponentCallback
Allows registering a mapping from TooltipData to TooltipComponent. This allows custom tooltips for items: first, override Item.getTooltipData(net.minecraft.item.ItemStack) and return a custom TooltipData. Second, register a listener to this event and convert the data to your component implementation if it's an instance of your data class.

Note that failure to map some data to a component will throw an exception, so make sure that any data you return in Item.getTooltipData(net.minecraft.item.ItemStack) will be handled by one of the callbacks.