Class HudTakeover

java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.gui.HudTakeover

public final class HudTakeover extends Object
Takes the HUD over: while a condition holds, the game's own HUD (hotbar, health, crosshair, chat, and whatever other mods add to it) is not drawn, and a view of the mod's own is drawn in its place. For looking through something: a scope, a lens, a helmet's visor.
HudTakeover.register(MyMod.id("scope"), () -> MyScope.isRaised(), (graphics, delta) -> MyScope.draw(graphics));
If several takeovers are active at once, the HUD is hidden and each draws, in the order they were registered. Client code only.
  • Method Details

    • register

      public static void register(net.minecraft.resources.Identifier id, BooleanSupplier active, HudTakeover.View view)
      Parameters:
      active - asked every frame; while true the HUD is this view's
      Throws:
      IllegalArgumentException - if the id is taken
    • unregister

      public static boolean unregister(net.minecraft.resources.Identifier id)