Class RenderLibHud

java.lang.Object
com.render.api.RenderLibHud

public final class RenderLibHud extends Object
Entry point for HUD rendering callbacks.
  • Method Details

    • bootstrap

      public static void bootstrap()
      Installs the HUD render hook used by the library.

      Call this once during client initialization before registering HUD renderers.

    • register

      public static RenderRegistration register(HudRenderer renderer)
      Registers a HUD renderer that is invoked every frame.
      Parameters:
      renderer - callback that draws into the HUD canvas
      Returns:
      a handle that unregisters the renderer when closed
    • register

      public static RenderRegistration register(ManagedHudLayout layout)
    • register

      @Deprecated(forRemoval=false, since="1.1.0") public static RenderRegistration register(net.minecraft.resources.Identifier id, HudWidget widget)
      Deprecated.
      Registers a retained HUD widget under the supplied id.
      Parameters:
      id - unique widget identifier
      widget - widget to render
      Returns:
      a handle that unregisters the widget when closed
    • isRegistered

      public static boolean isRegistered(net.minecraft.resources.Identifier id)
      Returns whether a retained HUD widget is registered for the supplied id.
      Parameters:
      id - widget identifier
      Returns:
      true when the widget is registered
    • unregister

      public static void unregister(net.minecraft.resources.Identifier id)
      Removes a retained HUD widget registration if present.
      Parameters:
      id - widget identifier
    • unregister

      public static void unregister(String modId)
    • openPlacementScreen

      public static void openPlacementScreen(String modId)
    • openPlacementScreen

      public static void openPlacementScreen(net.minecraft.resources.Identifier modId)
    • showToast

      public static ToastHandle showToast(ToastComponent toast)
      Shows a managed HUD toast. The library owns stacking, expiry, and cleanup.
      Parameters:
      toast - toast to display
      Returns:
      handle used to dismiss or inspect the toast
    • clearToasts

      public static void clearToasts()
      Clears all queued and visible HUD toasts.