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

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.util.Identifier
    Represents the event phase quilt_tooltip:convertible_tooltip_data which is used when converting this tooltip data to a TooltipComponent.
  • Method Summary

    Modifier and Type
    Method
    Description
    @ClientOnly net.minecraft.client.gui.tooltip.TooltipComponent
    Returns the associated component.
  • Field Details

    • EVENT_PHASE

      static final net.minecraft.util.Identifier EVENT_PHASE
      Represents the event phase quilt_tooltip:convertible_tooltip_data which is used when converting this tooltip data to a TooltipComponent. It runs after the Event.DEFAULT_PHASE in TooltipComponentCallback, 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