Skip to content

Developer API ​

Other plugins can create holograms, change their text for one player, and play animations.

Setup ​

Add the HologramBB jar as a provided (compile-only) dependency, and in your plugin.yml:

yaml
softdepend: [HologramBB]

Getting the API ​

java
HologramBBAPI api = Bukkit.getServicesManager().load(HologramBBAPI.class);
if (api == null) {
    // HologramBB is not installed
}

Examples ​

java
// A new hologram with one line, at a location.
api.create("welcome", location, "<gold>Welcome");

// A layer's text for one player only.
api.setText(player, "welcome", "line", "<gold>Welcome back, " + player.getName());

// An animation for one player.
api.play(player, "welcome", "bounce");

// Any setting, as in the file.
api.edit("welcome", Map.of("layers.line.glow", "#ffaa00"));

Holograms made through the API are ordinary files, so they survive restarts and can be edited in the web editor like any other.