Interface IEventListener


@OverrideOnly public interface IEventListener
Used to listen to generic Waila events.

Register implementations with IClientRegistrar.eventListener(mcp.mobius.waila.api.IEventListener, int)

  • Method Details

    • onHandleTooltip

      default void onHandleTooltip(ITooltip tooltip, ICommonAccessor accessor, IPluginConfig config)
      This event is fired just before the tooltip size is calculated. This is the last chance to make edits to the information being displayed.
    • onBeforeTooltipRender

      default void onBeforeTooltipRender(GuiGraphics ctx, Rectangle rect, ICommonAccessor accessor, IPluginConfig config, IEventListener.Canceller canceller)
      This event is fired just before the tooltip is rendered.
      Parameters:
      rect - the position and dimension of the tooltip, you can modify this to transform the tooltip
      canceller - call IEventListener.Canceller.cancel() to cancel this event, if canceled, the tooltip will not render
    • onAfterTooltipRender

      default void onAfterTooltipRender(GuiGraphics ctx, Rectangle rect, ICommonAccessor accessor, IPluginConfig config)
      This event is fired just after the tooltip is rendered.
      Parameters:
      rect - the position and dimension of the tooltip
    • getHoveredItemModName

      @Nullable default @Nullable String getHoveredItemModName(ItemStack stack, IPluginConfig config)
      This event is fired when item tooltip is displayed on container screen and waila showing the item's mod name.
      Returns:
      null if this listener doesn't decide the name, otherwise return a string