Download Hologram / Leaderboard API — Minecraft Mods — MetaMods

Hologram / Leaderboard API

Active

Downloads

0

Last update

10 months ago

Versions

1.19 — 1.21.4
Server
Libraries
Technological
Utils

Hologram / Leaderboard API

Visualize dynamic text directly within Minecraft's game space using modern packet-based hologram technology.

Key Features

  • Animated Text - Create moving and changing text effects
  • MiniMessage Support - Use modern text formatting with colors and styles
  • Packet-Based - High-performance display system without server load
  • Personalized Holograms - Each player sees their unique content
  • Dynamic Leaderboards - Automatic creation of ranking boards
  • Flexible Customization - Full control over appearance and behavior
  • Object Attachment - Ability to link holograms with other entities
  • Various Display Modes - Configuration for different gaming situations

Important information: compatibility limited to versions 1.19.4+. Does not work with Bedrock Edition players. This is exclusively a software library requiring integration into your projects.

Dependency Installation

For Gradle

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

dependencies {
  compileOnly 'com.github.max1mde:HologramAPI:1.4.7'
}

For Maven

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

<dependency>
  <groupId>com.github.max1mde</groupId>
  <artifactId>HologramAPI</artifactId>
  <version>1.4.7</version>
  <scope>provided</scope>
</dependency>

Add dependency to plugin.yml:

depend:
  - HologramAPI

Practical Usage Examples

Getting Manager Instance

private HologramManager hologramManager;

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

Creating Basic Hologram

TextHologram hologram = new TextHologram("unique_identifier")
    .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);

Display Management

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

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

Creating Leaderboard

Map<Integer, String> leaderboardData = new LinkedHashMap<>() {{
    put(1, "PlayerOne:1000");
    put(2, "PlayerTwo:950");
    put(3, "PlayerThree:900");
}};

TextHologram leaderboard = hologramManager.generateLeaderboard(
    location,
    leaderboardData,
    HologramManager.LeaderboardOptions.builder()
        .title("Top Players")
        .showEmptyPlaces(true)
        .scale(1.2f)
        .maxDisplayEntries(10)
        .suffix("kills")
        .build()
);
Project members
maximde

maximde

Developer

Created: 23 Jun 2024

ID: 24808