Class RenderTooltipEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RenderTooltipEvent
Direct Known Subclasses:
RenderTooltipEvent.Pre, RenderTooltipEvent.Texture

public abstract class RenderTooltipEvent extends net.neoforged.bus.api.Event
Fired during tooltip rendering. See the various subclasses for listening to specific events.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getItemStack

      public ItemStack getItemStack()
      Returns the item stack which the tooltip is being rendered for, or an empty item stack if there is no associated item stack.
      Returns:
      the item stack which the tooltip is being rendered for, or an empty item stack if there is no associated item stack
    • getGraphics

      public GuiGraphics getGraphics()
      Returns the graphics helper for the gui.
      Returns:
      the graphics helper for the gui
    • getComponents

      public List<ClientTooltipComponent> getComponents()
      Returns the unmodifiable list of tooltip components.

      Use ItemTooltipEvent or RenderTooltipEvent.GatherComponents to modify tooltip contents or components.

      Returns:
      the unmodifiable list of tooltip components
    • getX

      public int getX()
      Returns the X position of the tooltip box. By default, this is the mouse X position.
      Returns:
      the X position of the tooltip box
    • getY

      public int getY()
      Returns the Y position of the tooltip box. By default, this is the mouse Y position.
      Returns:
      the Y position of the tooltip box
    • getFont

      public Font getFont()
      Returns The font used to render the text.
      Returns:
      The font used to render the text