Download HologramLib | Leaderboards & Custom Holograms ⚡ — Minecraft Mods — MetaMods

HologramLib | Leaderboards & Custom Holograms ⚡

Active

Downloads

0

Last update

9 months ago

Versions

1.19 — 1.21.4
Server
Libraries
Technological
Utils

HologramLib | Leaderboards & Custom Holograms ⚡

🚀 Compatible with FOLIA, PAPER, PURPUR for Minecraft versions 1.19.4 - 1.21

HologramLib

An easy-to-use API for creating text, item, and block holograms based on packets with MiniMessage and emoji support.

✨ Key Features

  • Creation of text, item, and block holograms
  • Animated text effects
  • Support for MiniMessage format
  • Packet-based system
  • Individual holograms for each player
  • Leaderboard table generators
  • Flexible hologram appearance customization
  • Object attachment capability
  • Various rendering modes

🔧 Server Setup

Requirements:

  • Download the plugin .jar file
  • Install Packet Events API
  • Place files in server's plugins folder
  • Add dependency to your plugin

📋 Project Integration

Gradle

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

dependencies {
  compileOnly 'com.github.max1mde:HologramLib:1.6.2.1'
}

Maven

<repository>
  <id>jitpack.io</id>
  <url>https://jitpack.io&lt;/url&gt;
</repository>

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

Add to your plugin's plugin.yml:

depend:
  - HologramLib

💻 Usage Examples

Getting Manager Instance

private HologramManager hologramManager;

@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);

Displaying and Removing

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

Text Animation

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

Leaderboard example

Map<Integer, String> leaderboardData = new LinkedHashMap<>() {{
    put(1, "MaximDe:1000");
    put(2, "dream:950");
    put(3, "BastiGHG:500");
    put(4, "Wichtiger:400");
    // ... additional 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()
);
⚠ Important Information
  • API works only on Minecraft versions 1.19.4+
  • Holograms are not visible to Bedrock Edition players
  • Recommended to use Paper or its forks
  • This is a Java API and doesn't work as a standalone plugin
Project members
maximde

maximde

Developer

Created: 23 Jun 2024

ID: 68012