Reference
Developer API
Integrate other plugins with the HUD.
The plugin registers AdvancedHudApi with the Bukkit services manager. Add AdvancedHUD as a depend or softdepend in your plugin and look the service up after it has enabled.
AdvancedHudApi hud = Bukkit.getServicesManager().load(AdvancedHudApi.class);
if (hud != null) {
hud.registerPlaceholder("%bedwars_kills%", player -> String.valueOf(kills(player)));
hud.addWaypoint("Bed", "Waypoint", "arena", 120.5, -48.5);
}The developer API requires the Pro plan or higher. On a server whose license is on the Starter plan, registerPlaceholder, addWaypoint and showSubtitle throw an IllegalStateException with the message The developer API requires the Pro plan or higher. The other methods and the built-in commands work on every plan.
| Method | Purpose |
|---|---|
registerPlaceholder(token, resolver) | Provides a value for a placeholder. Called on the server thread at each HUD refresh, so keep it fast. Takes precedence over PlaceholderAPI. |
unregisterPlaceholder(token) | Removes it. |
addWaypoint(name, style, world, x, z) | Adds or replaces a waypoint until the next restart or reload. Returns false at the limit of 256. |
removeWaypoint(name) | Removes a waypoint. |
toggleHud(player) | Shows or hides a player's HUD and returns the new state. |
showSubtitle(player, text, duration) | Queues a subtitle for the player. See Subtitles. |
clearSubtitles(player) | Removes the player's current and queued subtitles. |
isRendering() | Whether a project is loaded and licensed. |