R

Let's create a plugin that called RanksCreator, the ting is that have commands, first is /RanksCreate (Rank name) color (Color ex : Red Blue Black all). second /RanksDelete (A Exist Rank Name) (Reason)

Kodari AI
KodariApr 21 at 6:33 pm 7,794 (v2)

I’ll create a ranks management plugin with commands to create and delete ranks with colors.

RanksCreator
A rank management system allowing server administrators to create and delete custom ranks with color formatting. Features include intuitive commands for rank creation with color selection, rank deletion with reason logging, persistent rank storage, and comprehensive rank management. Supports all standard Minecraft color codes and provides easy-to-use commands for managing server ranks.

Perfect! I’ve created the RanksCreator plugin with a complete ranks management system.

Features implemented:

  • /rankscreate <name> <color> - Creates a rank with any Minecraft color

  • /ranksdelete <name> <reason> - Deletes a rank with logged reason

  • Persistent storage in ranks.yml

  • Deletion logging in deletion_log.yml with timestamps and reasons

  • Full color validation with helpful error messages

  • Support for all Minecraft colors (Red, Blue, Black, White, Green, Yellow, Gold, Gray, Dark_Red, Dark_Blue, Dark_Green, Dark_Aqua, Light_Purple, etc.)

  • Configurable messages with color code support

  • Debug mode for troubleshooting

  • Permission system for both commands

The plugin is ready to build and use!

R

also Only Owner can do and the mod is for 1.20.6

Kodari AI
KodariApr 21 at 6:39 pm 5,065 (v2)

I’ll update the plugin to be OP-only and set the API version to 1.20.6.

Perfect! I’ve updated the plugin for 1.20.6 and made it OP-only:

Changes made:

  • ✅ Set API version to 1.20 (compatible with 1.20.6)

  • ✅ Added OP permission checks in both commands (sender.isOp())

  • ✅ Added “no-permission” message for non-OPs

  • ✅ Fixed permission typo in plugin.yml

  • ✅ Commands now require server operator status to use

Only server operators can now create and delete ranks!

R

add /setrank (player) (Ranks)

Kodari AI
KodariApr 21 at 6:49 pm 20,333 (v2)

All files created! The /setrank <player> <rank> command is now fully implemented with:

  • Player rank assignment with timestamp tracking

  • Persistent storage in playerdata.yml

  • OP-only permission requirement

  • Confirmation messages for both sender and target player

  • Full integration with existing rank system

R

one more ting is when you have set a rank to somone is gonna have the Rank name with the color chose when is created before is name

Kodari AI
KodariApr 21 at 6:54 pm 7,177 (v2)

I’ll add a display name feature so players show their rank with color before their name.

Perfect! I’ve added the display name feature. Now when a player has a rank:

Changes made:

  • ✅ Created PlayerListener that handles join/quit/chat events

  • ✅ Player display names show rank with color before their name (e.g., [&cAdmin] PlayerName)

  • ✅ Chat messages also show the rank prefix

  • ✅ Tab list (player list) shows the rank prefix

  • ✅ Display name updates immediately when rank is assigned

  • ✅ Customizable rank prefix format in config (default: [{rank}])

Features:

  • Ranks appear with their color in chat, tab list, and display names

  • Format is configurable: change rank-prefix-format in config.yml

  • Examples: [{rank}], {rank} |, « {rank} », etc.

  • Automatically loads/unloads player data on join/quit

R

no when a player with a rank is chatting before the name there gonna be the ranks name with the color choosed (i dont know if this is the setranks command issue)

Kodari AI
KodariApr 21 at 7:01 pm 6,446 (v2)

I see the issue! The chat event handler isn’t formatting the message correctly. Let me fix it so the rank appears properly in chat.

Let me simplify this by adding a getter for the PlayerListener in the main plugin class:

Perfect! I’ve fixed the chat display issue:

Changes made:

  • ✅ Fixed chat format to properly show rank before player name (e.g., [Admin] PlayerName: message)

  • ✅ Added getter for PlayerListener in main plugin class

  • ✅ Made /setrank command update the player’s display name immediately after assigning the rank

  • ✅ Chat now shows: [RankName] PlayerName: their message with the rank color

Now when a player with a rank chats, it will show their colored rank before their name!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
15 946
src/main/java/com/rankscreator/RanksCreator.java
package com.rankscreator;

import com.rankscreator.commands.RanksCreateCommand;
import com.rankscreator.commands.RanksDeleteCommand;
import com.rankscreator.commands.SetRankCommand;
import com.rankscreator.listener.PlayerListener;
import com.rankscreator.manager.PlayerDataManager;
import com.rankscreator.manager.RankManager;
import com.rankscreator.storage.RankStorage;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public final class RanksCreator extends JavaPlugin {

    private RankManager rankManager;
    private RankStorage rankStorage;
    private PlayerDataManager playerDataManager;
    private PlayerListener playerListener;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.rankStorage = new RankStorage(this);
        this.rankManager = new RankManager(this);
        this.playerDataManager = new PlayerDataManager(this);
        
        registerCommands();
        registerListeners();
        
        getLogger().info("RanksCreator has been enabled!");
    }

    @Override
    public void onDisable() {
        if (rankManager != null) {
            rankManager.saveAllRanks();
        }
        if (playerDataManager != null) {
            playerDataManager.saveAllPlayerData();
        }
        getLogger().info("RanksCreator has been disabled!");
    }

    private void registerCommands() {
        getCommand("rankscreate").setExecutor(new RanksCreateCommand(this));
        getCommand("ranksdelete").setExecutor(new RanksDeleteCommand(this));
        getCommand("setrank").setExecutor(new SetRankCommand(this));
    }

    private void registerListeners() {
        this.playerListener = new PlayerListener(this);
        getServer().getPluginManager().registerEvents(playerListener, this);
    }

    public String getMessage(String path) {
        return getConfig().getString("messages." + path, "");
    }

    public boolean debug() {
        return getConfig().getBoolean("debug", false);
    }
}