Abhimanyu Singh

Create a complete production-ready Minecraft Paper plugin named "LeaderboardPro".

PLUGIN COMPATIBILITY:

  • Paper 1.20.x through 1.21.x
  • One JAR compatible with all supported versions
  • Java 17+
  • Use Paper API
  • Use Vault for economy
  • Optional PlaceholderAPI support
  • Final JAR name: leaderboard.jar

LEADERBOARD TYPES:

  1. Top Money
  2. Top Kills
  3. Top Deaths
  4. Top Playtime
  5. Top Blocks Broken
  6. Top Blocks Placed
  7. Top Mobs Killed
  8. Top Distance Traveled
  9. Top XP
  10. Top Players

COMMANDS:

  • /lb
  • /lb help
  • /lb create <type> [name]
  • /lb remove <name>
  • /lb list
  • /lb tp <name>
  • /lb reload
  • /lb setline <name> <line>
  • /lb settype <name> <type>

CREATE SYSTEM:

  • When an admin runs /lb create <type> <name>, create the leaderboard exactly at their current location.
  • Save world, X, Y, Z, yaw and pitch.
  • Support unlimited leaderboards.
  • Allow multiple leaderboards in different worlds.
  • Prevent duplicate names.
  • Allow leaderboards to be moved or removed.
  • Save everything permanently in the database/config.

DISPLAY:

  • Hologram-style leaderboard above the selected location.
  • Show Top 10 by default.
  • Configurable Top 3/5/10/20.
  • Show position, player name and value.
  • Show player head where supported.
  • Automatically refresh the display.
  • Configurable lines and formatting.
  • Support color codes and MiniMessage if appropriate.
  • Optional GUI leaderboard opened with /lb.

GUI:

  • Clean inventory GUI.
  • Player head for each ranked player.
  • Rank number.
  • Player name.
  • Current value.
  • Configurable GUI title and size.
  • Configurable item slots.
  • Previous/Next page buttons.
  • Close button.
  • Separate GUI for each leaderboard type.
  • Clicking a player can show their statistics.

ECONOMY:

  • Vault integration.
  • Money leaderboard must read balances from the Vault economy provider.
  • Handle offline players.
  • If Vault/economy is missing, show a clear warning instead of crashing.

STATISTICS:

  • Track kills.
  • Track deaths.
  • Track playtime.
  • Track blocks broken.
  • Track blocks placed.
  • Track mobs killed.
  • Track distance traveled.
  • Track XP.
  • Track player joins.
  • Do not count data incorrectly when the server restarts.

DATABASE:

  • SQLite by default.
  • Store player statistics and leaderboard locations.
  • Optional MySQL/MariaDB support.
  • Use asynchronous database operations where safe.
  • Never block the main server thread with database queries.
  • Handle database errors safely.
  • Prevent data corruption and duplicate records.

PERMISSIONS:

  • leaderboard.use
  • leaderboard.admin
  • leaderboard.create
  • leaderboard.remove
  • leaderboard.reload
  • leaderboard.tp

ADMIN FEATURES:

  • /lb reload
  • /lb list
  • /lb create
  • /lb remove
  • /lb tp
  • Tab completion for commands and leaderboard types.
  • Permission checks.
  • Helpful error messages.
  • Admin debug option in config.

CONFIGURATION:

Create a complete config.yml containing:

  • Plugin prefix
  • Messages
  • Update interval
  • Maximum leaderboard positions
  • GUI settings
  • Hologram settings
  • Database settings
  • MySQL settings
  • Leaderboard formats
  • Permission messages
  • Enable/disable individual leaderboard types
  • Placeholder settings

PERFORMANCE:

  • Lightweight and optimized for large servers.
  • Cache leaderboard results.
  • Update only when necessary.
  • Avoid excessive database queries.
  • Never create unnecessary tasks for every player.
  • Properly cancel tasks when the plugin disables.
  • No memory leaks.

SAFETY/RELIABILITY:

  • Validate all commands and arguments.
  • Never crash if Vault, PlaceholderAPI or an economy plugin is missing.
  • Handle deleted/offline players.
  • Handle deleted worlds safely.
  • Handle server restarts safely.
  • Log useful errors to console.

FILES:

Provide the complete project with:

  • src/main/java/...
  • plugin.yml or paper-plugin.yml
  • config.yml
  • messages.yml
  • database files/classes
  • GUI classes
  • leaderboard manager
  • hologram manager
  • command system
  • listeners
  • pom.xml or build.gradle
  • README.md

IMPORTANT:

  • Give complete working source code, not examples or pseudocode.
  • All classes must compile together.
  • Do not leave TODOs or missing methods.
  • Make the plugin ready to build into leaderboard.jar.
  • No login/register system.
Kodari AI
KodariSep 9 at 6:11 am 4
LeaderboardPro
A comprehensive Minecraft Paper plugin that creates holographic leaderboards and GUI menus tracking player statistics including money, kills, deaths, playtime, blocks broken/placed, mobs killed, distance traveled, XP, and player data. Features configurable top 3/5/10/20 displays, auto-refresh, Vault economy integration, SQLite/MySQL storage, asynchronous database operations, unlimited leaderboards across worlds, GUI browsing with player heads, admin commands with tab completion, PlaceholderAPI support, and full config customization for messages, formats, and performance settings.
  1. Build the Maven/Paper project and plugin metadata.

  2. Add persistent SQLite/MySQL storage, async statistics tracking, and Vault economy support.

  3. Add leaderboard management, hologram rendering, GUI pagination, commands, permissions, and listeners.

  4. Add complete configuration, messages, and build documentation.

Created the complete LeaderboardPro project with:

  • Maven build targeting Java 17 and producing leaderboard.jar

  • Paper 1.20.x–1.21.x plugin metadata

  • SQLite default storage with optional MySQL/MariaDB

  • Async database operations and periodic statistic saving

  • Vault economy integration with safe missing-provider handling

  • Optional PlaceholderAPI support

  • Statistics tracking for kills, deaths, playtime, blocks, mobs, distance, XP, and joins

  • Persistent leaderboard locations with unlimited boards

  • Hologram displays using Paper text displays

  • Paginated GUI with player heads, navigation, close button, and entry details

  • Commands:

    • /lb

    • /lb help

    • /lb create

    • /lb remove

    • /lb list

    • /lb tp

    • /lb move

    • /lb setline

    • /lb settype

    • /lb reload

    • /lb open

  • Permissions, tab completion, configurable messages, formats, GUI, holograms, database, and leaderboard types

  • README.md, config.yml, messages.yml, plugin.yml, pom.xml, and manifest.kod

Abhimanyu Singh

Koi player ka name hi nahin dikh raha

Kodari AI
KodariSep 9 at 6:30 am 1

Leaderboard में player name दिखने की समस्या ठीक कर दी गई।

बदलाव:

  • Offline player का नाम Bukkit से resolve होगा।

  • Online player का current नाम प्राथमिकता से इस्तेमाल होगा।

  • पुराने या missing records में Unknown की जगह UUID का छोटा fallback दिखेगा।

  • Stats update होते समय player name भी cache में save होगा।

  • Hologram और GUI दोनों में resolved नाम दिखाई देगा।

Kodari can make mistakes. Review important code before using.
Files
src
manifest.kod
pom.xml
README.md
Code
22 1,613
src/main/java/com/leaderboardpro/LeaderboardPro.java
package com.leaderboardpro;

import com.leaderboardpro.command.LeaderboardCommand;
import com.leaderboardpro.database.DatabaseManager;
import com.leaderboardpro.gui.LeaderboardGuiManager;
import com.leaderboardpro.gui.GuiListener;
import com.leaderboardpro.hologram.HologramManager;
import com.leaderboardpro.leaderboard.LeaderboardManager;
import com.leaderboardpro.listener.StatsListener;
import com.leaderboardpro.stats.StatsManager;
import com.leaderboardpro.util.MessageService;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.concurrent.TimeUnit;

public final class LeaderboardPro extends JavaPlugin {
    private DatabaseManager database;
    private StatsManager statsManager;
    private HologramManager hologramManager;
    private LeaderboardManager leaderboardManager;
    private LeaderboardGuiManager guiManager;
    private MessageService messages;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("messages.yml", false);
        messages = new MessageService(this);
        database = new DatabaseManager(this);
        statsManager = new StatsManager(this, database);
        hologramManager = new HologramManager(this);
        leaderboardManager = new LeaderboardManager(this, database, statsManager, hologramManager);
        guiManager = new LeaderboardGuiManager(this, leaderboardManager, statsManager);

        Economy economy = setupEconomy();
        statsManager.setEconomy(economy);
        if (economy == null) {
            getLogger().warning(messages.raw("economy-missing"));
        }

        getServer().getPluginManager().registerEvents(new StatsListener(statsManager), this);
        getServer().getPluginManager().registerEvents(new GuiListener(guiManager), this);
        LeaderboardCommand command = new LeaderboardCommand(this, leaderboardManager, guiManager, messages);
        getCommand("lb").setExecutor(command);
        getCommand("lb").setTabCompleter(command);

        database.initialize().thenRun(() -> Bukkit.getScheduler().runTask(this, leaderboardManager::load));
        Bukkit.getScheduler().runTaskTimerAsynchronously(this, statsManager::flushOnline, 1200L, 1200L);
    }

    private Economy setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            return null;
        }
        RegisteredServiceProvider<Economy> registration = getServer().getServicesManager().getRegistration(Economy.class);
        return registration == null ? null : registration.getProvider();
    }

    @Override
    public void onDisable() {
        if (leaderboardManager != null) {
            leaderboardManager.shutdown();
        }
        if (hologramManager != null) {
            hologramManager.removeAll();
        }
        if (statsManager != null) {
            statsManager.flushAll().orTimeout(5, TimeUnit.SECONDS).exceptionally(error -> null).join();
        }
        if (database != null) {
            database.shutdown();
        }
    }

    public MessageService messages() { return messages; }
    public DatabaseManager database() { return database; }
    public StatsManager stats() { return statsManager; }
    public LeaderboardManager leaderboards() { return leaderboardManager; }
    public LeaderboardGuiManager gui() { return guiManager; }
}