Introduction
The BetterHud API provides a comprehensive interface for developers to interact with and extend BetterHud’s functionality. The API is designed to be multiplatform, supporting Bukkit, Fabric, and Velocity servers.API Architecture
BetterHud’s API is structured in two layers:Standard API
The standard-api module (BetterHud-standard-api) contains platform-independent interfaces and functionality. This is the core API that all platforms share.
Main Entry Points:
BetterHudAPI- The starting point for accessing the APIBetterHud- The main interface containing all functionality
PlaceholderManager- Manage custom placeholdersPopupManager- Control popup displaysHudManager- Manage HUD elementsCompassManager- Handle compass markers and trackingPlayerManager- Player-specific operationsDatabaseManager- Database interactionsConfigManager- Configuration managementTriggerManager- Event trigger handlingListenerManager- Custom event listenersShaderManager- Shader effectsTextManager- Text rendering and formatting
Platform-Specific APIs
Platform APIs extend the standard API with platform-specific functionality:- bukkit-api - Bukkit/Spigot/Paper specific features
- fabric-api - Fabric server mod specific features
- velocity-api - Velocity proxy specific features
Getting Started
To access the BetterHud API in your code:Core Concepts
Namespacing
BetterHud uses Adventure’s Key system for namespacing:Manager Access
All functionality is accessed through specialized managers:Reload Handling
BetterHud supports dynamic reloading with various flags:Resource Loading
BetterHud provides utilities for loading plugin resources:Dependencies
Adventure API
BetterHud uses Kyori Adventure for text components and cross-platform compatibility:- Adventure API version:
4.26.1 - Platform version:
4.4.1 - Examination version:
1.3.0
BetterCommand
Example Projects
Official example implementations:- Bukkit Example Plugin - Integration with MMOCore
- Fabric Example Mod - Fabric server implementation
API Stability
The BetterHud API follows semantic versioning. Methods marked with@ApiStatus.Internal are for internal use only and should not be used by external plugins.
Next Steps
Installation
Learn how to add BetterHud API to your project
