HomeJavaModsHologramLib | Leaderboards & Custom Holograms
HologramLib | Leaderboards & Custom Holograms
ModsJava

HologramLib | Leaderboards & Custom Holograms

by maximjsx · on Modrinth

Which build do you need?

This mod ships a separate file for every mod loader and every version of the game. Pick both, then download — the wrong build installs fine and then does nothing in the game.

Mod loader

Minecraft version

⬇ Download for 1.21.1–1.21.10 · Folia⬇ Download for 1.21.1–1.21.10 · Paper⬇ Download for 1.21.1–1.21.10 · Purpur⬇ Download for 1.21.6–1.21.7 · Spigot⬇ Download for 1.21.2–1.21.5 · Spigot⬇ Download for 1.21.2–1.21.5 · Bukkit
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.
HologramLib | Leaderboards & Custom Holograms — screenshot 1HologramLib | Leaderboards & Custom Holograms — screenshot 2

FOLIA ✅ PAPER ✅ PURPUR ✅ 1.19.4 - 1.21.5 ✅

Version Join Discord Server Version jitpack
HologramLib

An easy-to-use, packet-based text/item/block display hologram API with MiniMessage and emoji support.

FEATURES

DISCLAIMER This API only works on 1.19.4+
The holograms do not work for Bedrock players
There can be some issues when using spigot on older versions (Preferably use Paper or a fork of it)
It's just a Java API. This plugin does not work standalone.

SETUP

PROJECT SETUP

Gradle installation

repositories {
  maven { url 'https://jitpack.io' }
}

dependencies {
  compileOnly 'com.github.HologramLib:HologramLib:1.7.6'
}

Maven installation

<repository>
  <id>jitpack.io</id>
  <url>https://jitpack.io</url>
</repository>

<dependency>
  <groupId>com.github.HologramLib</groupId>
  <artifactId>HologramLib</artifactId>
  <version>1.7.6</version>
  <scope>provided</scope>
</dependency>

Add this to your plugin plugin.yml

depend:
  - HologramLib

Code examples

Getting the instance

private HologramManager hologramManager;

@Override
public void onLoad() {
    HologramLib.onLoad(this); /*Only needed if you shade HologramLib*/
}

@Override
public void onEnable() {
    hologramManager = HologramLib.getManager().orElse(null);
    if (hologramManager == null) {
        getLogger().severe("Failed to initialize HologramLib manager.");
        return;
    }
}

Creating a hologram

TextHologram hologram = new TextHologram("unique_id")
    .setMiniMessageText("<aqua>Hello world!")
    .setSeeThroughBlocks(false)
    .setBillboard(Display.Billboard.VERTICAL)
    .setShadow(true)
    .setScale(1.5F, 1.5F, 1.5F)
    .setTextOpacity((byte) 200)
    .setBackgroundColor(Color.fromARGB(60, 255, 236, 222).asARGB())
    .setAlignment(TextDisplay.TextAlignment.CENTER)
    .setViewRange(1.0)
    .setMaxLineWidth(200);

Spawning and despawning

hologramManager.spawn(hologram, <location>);
hologramManager.remove(hologram);

Animations

TextAnimation animation = new TextAnimation()
        .addFrame( "<red>First frame")
        .addFrame("<green>Second frame")
        .addFrame("Third frame\n" +
                "Second line in third frame")
        .addFrame("Last frame");
animation.setDelay(20L); // 1 second
animation.setDelay(20L * 2);
hologramManager.applyAnimation(this.hologram, animation);

Leaderboard

Map<Integer, String> leaderboardData = new LinkedHashMap<>() {{
    put(1, "MaximDe:1000");
    put(2, "dream:950");
    put(3, "BastiGHG:500");
    put(4, "Wichtiger:400");
    // ... more entries
}};

LeaderboardHologram leaderboard = hologramManager.generateLeaderboard(
        location,
        leaderboardData,
        LeaderboardHologram.LeaderboardOptions.builder()
                .title("Top Players - Kills")
                .showEmptyPlaces(true)
                .scale(1.2f)
                .maxDisplayEntries(10)
                .suffix("kills")
                .topPlayerHead(true)
                .build()
);

Wiki

Code examples & more https://github.com/HologramLib/HologramLib/wiki

Example/Showcase Plugin

https://github.com/HologramLib/ExamplePlugin

More info https://maximjsx.com/projects/hologramlib

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more