Start here
How the HUD is built
The whole HUD is run by HudModuleManager. It registers the seven built-in modules at startup, and the eymistaken_hud entrypoint lets addons register more, ticked, drawn and placed alongside them.
Ticking and drawing
On every client tick, SimpleCPSClient calls HudModuleManager#tickAll(Minecraft), which calls each module's tick(). While the HUD is drawn it calls renderAll(GuiGraphicsExtractor, float), and each enabled module draws itself in extractRenderState(GuiGraphicsExtractor, float).
The HUD layer is drawn before vanilla chat, so chat stays on top of every module, yours included.
What every module inherits
Each module extends HudModule, which handles the render position, rainbow color cycling and fading, and carries the settings contract behind both the editor's context menu and your module's own page in the settings screen.
this.client | Minecraft.getInstance(), set in the constructor. |
|---|---|
this.x, this.y | Where the layout engine placed the module this frame. Translate to them before drawing. |
getRainbowColor() | The current rainbow color as ARGB, for a module that offers a rainbow mode. |
drawText(), textWidth(), col() | Text that follows the player's Text Outline setting, and colors that follow the fade. See the helpers. |
Where modules go
Placement is worked out fresh every frame from each module's anchor, offsets and size.
| Corners | TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT and BOTTOM_RIGHT stack automatically along their edge, so modules sharing a corner never overlap. |
|---|---|
| Center | CENTER modules are centered rather than stacked, so several centered modules overlap unless your addon offsets them. |
| Manual | Any non-zero offset, or a drag in the editor, takes a module out of the stack. It is placed exactly where it was put, clamped to the screen. |
| Prevent Overlap | With the player's Prevent Overlap on, a module dropped onto another is moved to the nearest free spot. |
The size you report is the size you get. Stacking, the editor's hit boxes and the preview card all read getWidth() and getHeight(). A module that reports 0 has no place in the layout at all.
Where an addon comes in
Addons are found through the eymistaken_hud Fabric entrypoint during client initialization, after the config has been read. Each one is a class implementing EymistakenHudPlugin.
void registerHudModules(HudModuleManager manager)since 1.1.0Register your modules with manager.registerModule(). A module whose name is already taken is refused and logged; manager.isNameTaken(String) checks first.
void registerEvents(EymistakenHudEventBus bus)since 1.2.0Subscribe to HUD events. Called once at client init, right after registerHudModules. A no-op by default.
A registered module is ticked, drawn, dragged in the editor and listed in the settings screen like the built-in seven, and it can opt into presets, share codes and server configs through plugin state.