Interface ItemTooltipCallback

All Superinterfaces:
ClientEventAwareListener

@ClientOnly public interface ItemTooltipCallback extends ClientEventAwareListener
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Fired after the game has appended all base tooltip lines to the list.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onTooltipRequest(net.minecraft.item.ItemStack stack, @Nullable net.minecraft.entity.player.PlayerEntity player, net.minecraft.item.Item.TooltipContext context, net.minecraft.client.item.TooltipConfig config, List<net.minecraft.text.Text> lines)
    Called when an item stack's tooltip is rendered.
  • Field Details

    • EVENT

      static final Event<ItemTooltipCallback> EVENT
      Fired after the game has appended all base tooltip lines to the list.
  • Method Details

    • onTooltipRequest

      void onTooltipRequest(net.minecraft.item.ItemStack stack, @Nullable @Nullable net.minecraft.entity.player.PlayerEntity player, net.minecraft.item.Item.TooltipContext context, net.minecraft.client.item.TooltipConfig config, List<net.minecraft.text.Text> lines)
      Called when an item stack's tooltip is rendered. Text added to lines will be rendered with the tooltip.
      Parameters:
      stack - the item for which the tooltip is requested
      player - the player who requested the tooltip, may be null
      context - the tooltip context
      config - the tooltip config
      lines - the list containing the lines of text displayed on the stack's tooltip