Class RenderTooltipEvent.Texture

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RenderTooltipEvent
net.neoforged.neoforge.client.event.RenderTooltipEvent.Texture
Enclosing class:
RenderTooltipEvent

public static class RenderTooltipEvent.Texture extends RenderTooltipEvent
Fired when the textures for the tooltip background are determined. This can be used to modify the background and frame texture.

This event is not cancellable.

This event is fired on the main Forge event bus, only on the logical client.

  • Field Details

    • originalTexture

      private final @Nullable Identifier originalTexture
    • texture

      private @Nullable Identifier texture
  • Constructor Details

  • Method Details

    • getOriginalTexture

      public @Nullable Identifier getOriginalTexture()
      Returns the original texture location given to the tooltip render method (may originate from DataComponents.TOOLTIP_STYLE).
      Returns:
      the original texture location given to the tooltip render method (may originate from DataComponents.TOOLTIP_STYLE)
    • getTexture

      public @Nullable Identifier getTexture()
      Returns the texture location that will be used to render the tooltip.
      Returns:
      the texture location that will be used to render the tooltip
    • setTexture

      public void setTexture(@Nullable Identifier texture)
      Set the texture to use for the tooltip background and frame or null to use the default textures.

      The given Identifier will be prefixed with tooltip/ and suffixed with _background and _frame to determine the background and frame texture respectively