类 RenderTooltipEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.RenderTooltipEvent
直接已知子类:
RenderTooltipEvent.Background, RenderTooltipEvent.Pre

public abstract class RenderTooltipEvent extends net.minecraftforge.eventbus.api.Event
Fired during tooltip rendering. See the various subclasses for listening to specific events.
另请参阅:
  • 字段详细资料

    • itemStack

      @NotNull protected final @NotNull ItemStack itemStack
    • graphics

      protected final GuiGraphics graphics
    • x

      protected int x
    • y

      protected int y
    • font

      protected Font font
    • components

      protected final List<ClientTooltipComponent> components
  • 构造器详细资料

  • 方法详细资料

    • getItemStack

      @NotNull public @NotNull ItemStack getItemStack()
      返回 the item stack which the tooltip is being rendered for, or an empty item stack if there is no associated item stack。
      返回:
      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()
      返回 the graphics helper for the gui。
      返回:
      the graphics helper for the gui
    • getComponents

      @NotNull public @NotNull List<ClientTooltipComponent> getComponents()
      返回 the unmodifiable list of tooltip components。

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

      返回:
      the unmodifiable list of tooltip components
    • getX

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

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

      @NotNull public @NotNull Font getFont()
      返回 The font used to render the text。
      返回:
      The font used to render the text