Module Structure
BetterHud is organized into several key modules:API Layer
Platform-agnostic interfaces for core functionality
Platform Implementations
Bukkit, Velocity, and Fabric-specific adapters
Distribution Module
Default configurations and resource pack assets
NMS Handlers
Version-specific Minecraft protocol implementations
API Modules
The API layer is divided into platform-specific and standard APIs:The standard API (
kr.toxicity.hud.api) contains all core interfaces like Hud, Popup, Compass, and manager classes.Platform Bootstraps
Each platform has its own bootstrap module that initializes BetterHud:bootstrap:bukkit- Bukkit/Spigot/Paper plugin initializationbootstrap:velocity- Velocity proxy plugin initializationbootstrap:fabric- Fabric server-side mod initialization
Core Architecture
Plugin Initialization
The bootstrap loads the appropriate platform adapter and initializes the BetterHud core
Manager Registration
All managers (HudManager, PopupManager, CompassManager, etc.) are registered and initialized
Configuration Loading
YAML configurations are parsed from the
huds/, popups/, compasses/, etc. directoriesManager System
BetterHud uses a manager-based architecture to organize functionality:Key Managers
| Manager | Purpose | API Reference |
|---|---|---|
| HudManager | Manages persistent HUD displays | BetterHud.getInstance().getHudManager() |
| PopupManager | Manages temporary popup notifications | BetterHud.getInstance().getPopupManager() |
| CompassManager | Manages compass and waypoint displays | BetterHud.getInstance().getCompassManager() |
| PlaceholderManager | Resolves placeholders in HUD elements | BetterHud.getInstance().getPlaceholderManager() |
| PlayerManager | Manages per-player HUD state | BetterHud.getInstance().getPlayerManager() |
| TriggerManager | Handles event-based HUD updates | BetterHud.getInstance().getTriggerManager() |
All managers are accessible through the main
BetterHud interface: BetterHud.getInstance().getXxxManager()HudObject System
All displayable elements inherit from theHudObject interface:
- Hud - Persistent HUD elements (see Huds)
- Popup - Temporary notifications (see Popups)
- Compass - Directional indicators (see Compass)
HudPlayer System
Each online player has aHudPlayer instance that tracks:
- Active HUD Objects - Currently displayed HUDs, popups, and compasses
- Popup State - Popup queue and animation state
- Variables - Per-player placeholder variables
- Tick Counter - Animation and update timing
- Pointed Locations - Compass markers and waypoints
Resource Pack Generation
BetterHud automatically generates a resource pack containing:Font Files
Font Files
Custom fonts with HUD element glyphs mapped to Unicode private use characters
Image Assets
Image Assets
PNG images converted to font glyphs for display
Shader Configuration
Shader Configuration
Custom shaders for advanced rendering effects
Font Metadata
Font Metadata
JSON font provider files mapping characters to images
The resource pack is generated on plugin reload and must be distributed to players. See Resource Packs for details.
Update System
BetterHud uses a tick-based update system:- Global Tick - Plugin tracks overall tick count
- Player Tick - Each HudPlayer has its own tick counter
- Object Tick - Each HudObject defines its update frequency
- Trigger Events - External events trigger immediate updates
Event-Driven Architecture
BetterHud uses triggers to respond to game events:Triggers are configured in HUD/Popup YAML files. See Triggers for available trigger types.
Platform Abstraction
BetterHud abstracts platform differences through adapter interfaces:- LocationWrapper - Platform-agnostic location
- WorldWrapper - Platform-agnostic world reference
- BetterCommandSource - Unified command sender interface
Next Steps
Huds
Learn about persistent HUD elements
Popups
Understand temporary notification displays
Compass
Explore directional indicators and waypoints
Resource Packs
How BetterHud generates and distributes resource packs
