Demir Tutal

CUSTOMRANKS — COMPLETE MASTER DEVELOPMENT PROMPT

Create a complete, working Minecraft plugin named CustomRanks for Minecraft Java 26.2, Paper, and Java 25. Verify actual compatibility with the target versions before claiming support.

Do not just provide code snippets or instructions. Create the complete project, compile it into a ".jar", run available tests, fix errors, rebuild, and provide the final JAR and source code.

  1. Rank System

Implement these commands:

  • "/rank create <name>" — Create a rank using the executing player's current inventory and equipped armor as the rank kit.
  • "/rank give <player> <rank>" — Assign a rank to a player.
  • "/rank remove <player>" — Remove a player's rank.
  • "/rank delete <name>" — Delete a rank.
  • "/rank kit" — Give the executing player their own assigned rank's kit.
  • "/rank reload" — Reload plugin configuration.

Requirements:

  • Only authorized administrators can create, assign, remove, or delete ranks.
  • Store rank assignments persistently using player UUIDs.
  • Display the player's rank above their head and in the TAB list.
  • Refresh rank displays when a player's rank changes and when they join the server.
  • Save the complete kit, including armor, inventory contents, enchantments, item names, lore, and other supported item metadata.
  • Add configurable permissions for administrative commands.
  1. Critical "/rank kit" Security

When a player executes "/rank kit", the plugin must automatically determine their rank from their saved UUID-based assignment.

  • Players must receive only their own assigned rank's kit.
  • Do not allow players to obtain another rank's kit by entering a rank name or modifying command arguments.
  • Do not expose another rank's kit through tab completion or an unprotected alternative command.
  • If a player has no rank, display a clear message and give no kit.
  • Enforce the configured cooldown for each player.
  • Persist cooldown timestamps so restarting the server does not reset cooldowns.
  • Prevent duplicate claims, cooldown bypasses, and item duplication through repeated commands.
  1. Critical Armor Equipping Fix

When a player executes "/rank kit", armor must be equipped directly instead of being dropped on the ground.

Implement this correctly using the supported Paper/Bukkit inventory API.

  • Equip helmets, chestplates, leggings, and boots directly into their correct armor slots.
  • Preserve enchantments, durability, item metadata, and other supported properties.
  • Do not drop armor on the ground during normal kit delivery.
  • If an armor slot is occupied, safely move the existing armor into the player's inventory before equipping the kit armor.
  • If the player's inventory is full, handle remaining items safely. Never silently delete items or duplicate them.
  • Handle empty armor slots, missing armor pieces, and incompatible items correctly.
  • Ensure the same behavior works for every rank kit, not just one rank.
  • Test the actual command in a running test server whenever possible. Do not claim the issue is fixed until the implementation and available tests support that conclusion.
  1. Team System

Implement these commands:

  • "/team create <name>"
  • "/team invite <player>"
  • "/team accept"
  • "/team leave"
  • "/team kick <player>"
  • "/team info"
  • "/team chest"
  • "/team disband"

Requirements:

  • Each team has exactly one owner.
  • Display the owner's tag as "[TeamName Owner]", for example "[Law Owner]".
  • Only the owner may invite or kick members, manage team settings, or disband their own team.
  • Players cannot manage another team's members or storage.
  • Invitations must expire after a configurable period.
  • Prevent players from joining multiple teams simultaneously unless explicitly configured otherwise.
  • Team membership and ownership must persist across server restarts.
  • "/team chest" opens a shared, persistent team storage inventory.
  • Only authorized team members can access their team's chest.
  • Revoke access immediately when a player leaves or is kicked.
  • Add a team PvP setting so members can configure whether teammates can damage one another.
  • When "/team kick <player>" is used, remove the kicked player from the team and remove their custom rank assignment as specified for this server. Ensure this behavior is explicit, permission-checked, and does not affect unrelated players or teams.
  1. Configuration and Storage

Create a clear "config.yml" containing:

  • Rank and team settings.
  • Kit cooldown duration.
  • Messages and formatting.
  • Command permissions.
  • Invitation expiration.
  • Team PvP defaults.
  • Other important configurable options.

Store data safely and persistently. Use UUIDs rather than player names as the primary player identifier. Avoid data corruption, item duplication, and unauthorized access.

  1. Testing and Build Requirements

Before delivering the plugin:

  1. Create the complete project with all required source files and build configuration.
  2. Verify target Java, Paper API, and Minecraft version compatibility using real available dependencies.
  3. Compile the plugin and fix all build errors.
  4. Test rank creation, assignment, removal, deletion, and kit delivery.
  5. Verify that a player cannot obtain another rank's kit.
  6. Verify that "/rank kit" equips armor directly and does not drop it.
  7. Test occupied armor slots, full inventories, cooldown persistence, and server restarts.
  8. Test team ownership, invitations, kicking, shared storage, and permissions.
  9. Rebuild after every code fix.
  10. Provide the final ".jar", complete source code, build instructions, and a concise report of tests performed.

Do not claim a feature works, a test passed, or a JAR was built unless it actually happened. If the target Minecraft/Paper version is unavailable or incompatible with the available tooling, clearly explain the limitation and provide the closest verified alternative.

Priority: Correct "/rank kit" behavior is essential. Players must receive only their own rank kit, armor must be equipped directly, and items must never be silently lost or duplicated.

Kodari AI
KodariOct 27 at 9:51 am 2
CustomRanks
A comprehensive Minecraft Paper plugin implementing a persistent rank and team system. Admins create ranks from player inventories, assign them via UUID, and control kit delivery with configurable cooldowns. Players receive only their own rank's kit with armor equipped directly to correct slots. Teams feature owner-based management, expiring invitations, shared persistent storage, and configurable PvP. All data persists across restarts with UUID-based storage, and displays rank above heads and in TAB lists.
  1. Build the rank system with UUID assignments, persisted cooldowns, secure /rank kit, and safe armor delivery.

  2. Add persistent teams, ownership, invitations, shared storage, PvP controls, and kick behavior.

  3. Wire configuration/permissions together and report what could—and could not—be verified here.

Created the CustomRanks project with rank kits, UUID-based assignments, persisted cooldowns, configurable permissions/messages, team membership and ownership, expiring invitations, shared persistent chests, and team PvP controls.

/rank kit uses only the player’s saved rank. Delivery checks inventory capacity before changing anything, equips compatible kit armor directly, and moves displaced armor into storage. If there isn’t enough room, the claim is refused without changing the inventory.

Verification limits: I could not run a build or a Paper test server here, so I can’t claim compatibility with Paper 26.2, report passing tests, or provide a built JAR. The project is configured for Java 25 and the 26.2-R0.1-SNAPSHOT Paper API, but that dependency’s availability and compatibility remain unverified. Rank, armor, cooldown, and team scenarios—including restart behavior—were not tested in-game.

To build and download the JAR in Kodari: click Compile in the top bar (on phone: ⋮ → Compile Project), click Compile, then Download when the build succeeds.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
9 1,490
src/main/java/com/kodari/customranks/CustomRanksPlugin.java
package com.kodari.customranks;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Collections;
import java.util.List;

public final class CustomRanksPlugin extends JavaPlugin implements Listener {
    private RankManager rankManager;
    private TeamManager teamManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        rankManager = new RankManager(this);
        teamManager = new TeamManager(this);
        setTeamManager(teamManager);
        getServer().getPluginManager().registerEvents(this, this);
        getServer().getPluginManager().registerEvents(teamManager, this);
        RankCommand rankCommand = new RankCommand(this, rankManager);
        getCommand("rank").setExecutor(rankCommand);
        getCommand("rank").setTabCompleter(rankCommand);
        TeamCommand teamCommand = new TeamCommand(this, teamManager);
        getCommand("team").setExecutor(teamCommand);
        getCommand("team").setTabCompleter(teamCommand);
        for (Player player : Bukkit.getOnlinePlayers()) {
            refreshPlayerDisplay(player);
        }
    }

    @Override
    public void onDisable() {
        if (teamManager != null) {
            teamManager.saveAll();
        }
        if (rankManager != null) {
            rankManager.saveAll();
        }
    }

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        refreshPlayerDisplay(event.getPlayer());
    }

    public RankManager getRankManager() {
        return rankManager;
    }

    public TeamManager getTeamManager() {
        return teamManager;
    }

    void setTeamManager(TeamManager teamManager) {
        this.teamManager = teamManager;
    }

    public boolean hasPermission(org.bukkit.command.CommandSender sender, String configPath) {
        if (!(sender instanceof Player player)) {
            return true;
        }
        String permission = getConfig().getString(configPath, "");
        return permission.isBlank() || player.hasPermission(permission);
    }

    public String message(String key, String... replacements) {
        String text = getConfig().getString("messages." + key, "&cMissing message: " + key);
        for (int index = 0; index + 1 < replacements.length; index += 2) {
            text = text.replace("{" + replacements[index] + "}", replacements[index + 1]);
        }
        String prefix = getConfig().getString("messages.prefix", "");
        return color(prefix + text);
    }

    public static String color(String text) {
        return ChatColor.translateAlternateColorCodes('&', text);
    }

    public void refreshPlayerDisplay(Player player) {
        StringBuilder prefix = new StringBuilder();
        if (teamManager != null) {
            prefix.append(teamManager.getDisplayPrefix(player.getUniqueId()));
        }
        String rank = rankManager.getRank(player.getUniqueId());
        if (rank != null) {
            prefix.append(getConfig().getString("ranks.display-format", "&8[&b{rank}&8] ")
                    .replace("{rank}", rank));
        }

        String coloredPrefix = color(prefix.toString());
        player.setPlayerListName(coloredPrefix + player.getName());
        Scoreboard scoreboard = player.getScoreboard();
        String teamName = "cr" + player.getUniqueId().toString().replace("-", "").substring(0, 14);
        Team previous = scoreboard.getTeam(teamName);
        if (previous != null) {
            previous.unregister();
        }
        if (!prefix.isEmpty()) {
            Team displayTeam = scoreboard.registerNewTeam(teamName);
            displayTeam.setPrefix(coloredPrefix);
            displayTeam.addEntry(player.getName());
        }
    }

    public List<String> onlineNames() {
        return Bukkit.getOnlinePlayers().stream().map(Player::getName).toList();
    }

    public List<String> emptySuggestions() {
        return Collections.emptyList();
    }
}