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
    Modifier and Type
    Field
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @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.
  • Field Details

  • 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.