Interface StatusBarOverlayRenderEvents.RenderHealthBarCallback

Enclosing class:
StatusBarOverlayRenderEvents
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface StatusBarOverlayRenderEvents.RenderHealthBarCallback
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    render(net.minecraft.client.gui.GuiGraphics context, net.minecraft.world.entity.player.Player player, org.joml.Vector2i[] heartPositions, int displayHealth, int maxDisplayHealth)
    Note that displayHealth and maxDisplayHealth are not always the same as health and max health.
  • Method Details

    • render

      void render(net.minecraft.client.gui.GuiGraphics context, net.minecraft.world.entity.player.Player player, org.joml.Vector2i[] heartPositions, int displayHealth, int maxDisplayHealth)
      Note that displayHealth and maxDisplayHealth are not always the same as health and max health. Mods that override the health bar rendering like Colorful Hearts may change these values.
      Parameters:
      context - DrawContext for the HUD
      player - The player rendering hearts for
      heartPositions - An array of heart positions on the HUD. Elements may be null, indicating that a heart should not be rendered at this index.
      displayHealth - How many half hearts are to be displayed
      maxDisplayHealth - The maximum number of half hearts to be displayed