HologramLib | Leaderboards & Custom Holograms
Packet-based text display library with animations, leaderboards, emojis, minimessage, and more!
HologramLib | Leaderboards & Custom Holograms
<center> <p><b>FOLIA ✅ PAPER ✅ PURPUR ✅ 1.19.4 - 1.21.5 ✅</b></p> <a href="https://github.com/HologramLib/HologramLib"><img src="https://img.shields.io/badge/Source%20Code-c372ea" alt="Version"></a> <a href="https://discord.gg/2UTkYj26B4" target="_blank"><img src="https://img.shields.io/badge/Discord_Server-7289DA?style=flat&logo=discord&logoColor=white" alt="Join Discord Server" style="border-radius: 15px; height: 20px;"></a> <a href="https://github.com/HologramLib/HologramLib/wiki"><img src="https://img.shields.io/badge/Wiki-13B8E1" alt="Version"></a> <a href="https://jitpack.io/#HologramLib/HologramLib"><img src="https://jitpack.io/v/HologramLib/HologramLib.svg" alt="jitpack"></a> <br>
<img src="https://github.com/user-attachments/assets/75e2fce6-0be0-4621-be38-ff1d0cb5ca0a" alt="HologramLib">
An easy-to-use, packet-based text/item/block display hologram API with MiniMessage and emoji support. </center>
FEATURES
- Text, Block & Item Holograms - Text animations - Minimessage support - Packet based - Per player holograms - Leaderboard generators - Advanced hologram customization - Attachment and parenting support - Flexible rendering modes
DISCLAIMER
This API only works on 1.19.4+ <br> The holograms do not work for Bedrock players <br> There can be some issues when using spigot on older versions (Preferably use Paper or a fork of it)<br> It's just a Java API. This plugin does not work standalone. <br>
SETUP
- Download the plugin .jar - Download Packet Events - Upload the .jar files onto your server (*yourserver/plugins* folder) - Add the plugin as a dependency to your plugin and use it
PROJECT SETUP
Gradle installation ```groovy repositories { maven { url 'https://jitpack.io' } }
dependencies { compileOnly 'com.github.HologramLib:HologramLib:1.7.6' } ``` Maven installation ```xml <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` ```yml depend: - HologramLib ```
Code examples
Getting the instance
```java 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
```java 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
```java hologramManager.spawn(hologram, <location>); hologramManager.remove(hologram); ```
Animations
```java TextAnimation animation = new TextAnimation() .addFrame( "<red>First frame") .addFrame("<green>Second frame") .addFrame("Third framen" + "Second line in third frame") .addFrame("Last frame"); animation.setDelay(20L); // 1 second animation.setDelay(20L * 2); hologramManager.applyAnimation(this.hologram, animation); ```
Leaderboard
<img src="https://github.com/max1mde/HologramLib/raw/master/assets/leaderboard.png" width="600">
```java 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
<a alt="o7studios" href="https://o7.studio"><img src="https://i.imgur.com/pniirmi.png"></a>