fr0ll3ncs

leaderboard addon that supports ajleaderboards but look like the hypixel's leaderboards with a menu like this (this is how the menu look from bedwars hypixel though and the menu for each mode)

1 image attached
Kodari AI
KodariSep 10 at 10:30 am 2
HypixelStyleLeaderboards
Creates a Hypixel-style leaderboard menu system for Minecraft Bukkit/Spigot servers, integrating with AJLeaderboards. Features a visually polished GUI with a main menu displaying game modes and categories, and sub-menus for each mode showing top player rankings. Uses the inventory GUI framework with clickable buttons, custom item icons, and dynamic data loading. Players can navigate through modes, view stats, and refresh leaderboards. Designed to mimic the aesthetic and interactive feel of Hypixel's Bedwars leaderboard interface, with smooth transitions and intuitive navigation.

Implemented a complete Hypixel-style leaderboard addon from scratch.

  • Added /leaderboards, /lb, and /leaderboard commands.

  • Added main mode-selection menu and individual leaderboard menus.

  • Added configurable modes, icons, titles, filler items, lore, refresh, and back buttons.

  • Added AJLeaderboards support through PlaceholderAPI placeholders.

  • Added configurable fallback leaderboard entries.

  • Added caching and refresh handling.

  • Added cross-version XSeries item support.

  • Added Gradle build configuration and plugin metadata.

Configure additional modes in src/main/resources/config.yml using the existing examples.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
11 578
src/main/java/com/kodari/leaderboards/LeaderboardPlugin.java
package com.kodari.leaderboards;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.bukkit.ChatColor;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.plugin.java.JavaPlugin;

public class LeaderboardPlugin extends JavaPlugin {
    private final Map<String, ModeDefinition> modes = new LinkedHashMap<>();
    private LeaderboardService service;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        loadModes();
        int topSize = getConfig().getInt("settings.top-size", 10);
        int cacheSeconds = getConfig().getInt("settings.cache-seconds", 15);
        service = new LeaderboardService(topSize, cacheSeconds);

        getServer().getPluginManager().registerEvents(new LeaderboardListener(), this);
        if (getCommand("leaderboards") != null) {
            LeaderboardCommand command = new LeaderboardCommand(this);
            getCommand("leaderboards").setExecutor(command);
            getCommand("leaderboards").setTabCompleter(command);
        }
        getLogger().info("Loaded " + modes.size() + " leaderboard modes.");
    }

    public void openMain(org.bukkit.entity.Player player) {
        new LeaderboardMenu(this, service, modes, LeaderboardMenu.MenuView.MAIN, null).open(player);
    }

    public void openMode(org.bukkit.entity.Player player, String modeId) {
        ModeDefinition mode = getMode(modeId);
        if (mode != null) {
            new LeaderboardMenu(this, service, modes, LeaderboardMenu.MenuView.MODE, mode).open(player);
        }
    }

    public Map<String, ModeDefinition> getModes() {
        return modes;
    }

    public ModeDefinition getMode(String id) {
        return id == null ? null : modes.get(id.toLowerCase(Locale.ROOT));
    }

    public String color(String text) {
        return ChatColor.translateAlternateColorCodes('&', text == null ? "" : text);
    }

    private void loadModes() {
        modes.clear();
        ConfigurationSection section = getConfig().getConfigurationSection("modes");
        if (section == null) {
            getLogger().warning("No modes are configured in config.yml.");
            return;
        }

        for (String id : section.getKeys(false)) {
            ConfigurationSection mode = section.getConfigurationSection(id);
            if (mode == null) {
                continue;
            }
            List<LeaderboardEntry> fallbackEntries = new ArrayList<>();
            for (Map<?, ?> rawEntry : mode.getMapList("entries")) {
                Object rawName = rawEntry.get("name");
                Object rawValue = rawEntry.get("value");
                if (rawName != null) {
                    fallbackEntries.add(new LeaderboardEntry(String.valueOf(rawName),
                            rawValue == null ? "0" : String.valueOf(rawValue)));
                }
            }

            String normalizedId = id.toLowerCase(Locale.ROOT);
            modes.put(normalizedId, ModeDefinition.builder()
                    .id(normalizedId)
                    .displayName(mode.getString("display-name", id))
                    .icon(mode.getString("icon", "BOOK"))
                    .board(mode.getString("board", id))
                    .source(mode.getString("source", "static"))
                    .namePlaceholder(mode.getString("name-placeholder", ""))
                    .valuePlaceholder(mode.getString("value-placeholder", ""))
                    .fallbackEntries(fallbackEntries)
                    .build());
        }
    }
}