drift_abc

create a Clan plugin for a minecraft 1.21.11 paper server which has clan placeholders that can bind with placeholder apis and you would also need some luckperm integration later with what im about to describe. i want the clan plugin to have placeholders of players clan names there and whatever placeholder cuz i want to display players clan name iin main chat before their names. i want to have a /clan command with sub commands of create disband, mod, rank, invite, join, name and whatevers possible and apply for these. i actually want the plugin to have create cmd with the clan name and the clan name should support hex color codes also i want a /clan chat or a /cc command that enable clan chat. what happoens is that after typing this command whatever the player types in the chat isnt shown in main chat instead its shown in a clan chat where only the memebers of the clan can see it. the clan chat leader should have access to all clan commands a player should have and the normal clan member who isnt a leader of the clan or a clan moderator will have only access to specific commands. i also want a /clan sethome and /clan home cmd which you know basically what means so the leader and clan moderator can set clan homes and everyone can visit that home by doing /clan home also make a /c top thing where the clan with the leader having most kdr or kill death ratio clan will be top only leader kdr. there should also be command to add /clan addmod or /clan delmod which lets the leader only add the clan moderator or delete a existing clan modeartor and the modeartor can invite and /clan kick players too and can also do /clan sethome and yeah i forgot to tell also add the /clan delhome command. 1 clan can set only 1 clan home not more then that and there should also be a cmd with /clan pvp which enables pvp or diables pvp between clan members this cmd acces is in hand of leader and moderator. also be mindful of what commands access to give to server operators what to give to clan leaders what to give to clan modearators and what to give to clan members also in the clan chat the normal member has this interface when he sends a clan chat msg &b%player%: his message for the leader it is&6%player%: his message and for modearator &a%player%: his message and also add the /clan rank which gives a prefix before players name only visible in clan chat before players name and it can be set with hex color codes support by leader by /clan rank (player that is recieveing the rank) (clan rank with hex color code support) and in /c top also the clan names should appear in colors if they are with color. be mindful about what you are doing as you get only 1 chance to create the plugin also add a /clan info (clan name without hex code if any hex code) this will show the clan memebers and its leaders and moderators and position in /clan top in chat also in /clan top only top 10 clans are to be displayed not more then that

Kodari AI
KodariApr 28 at 11:09 am 27,031 (v2)

I’ll create a comprehensive clan management plugin with all the features you requested.

ClanSystem
A comprehensive clan management plugin with hex color support, PlaceholderAPI integration, clan chat, homes, PvP toggle, custom ranks, and a top clans leaderboard based on leader KDR. Features role-based permissions with leader, moderator, and member roles. Includes commands for clan creation, management, invitations, and a dedicated clan chat mode. Supports LuckPerms integration and provides placeholders for displaying clan names in chat.

I’ll create a full-featured clan system with role-based permissions, hex color support, PlaceholderAPI integration, clan chat, homes, PvP management, and a KDR-based leaderboard.

Perfect! I’ve created a comprehensive clan management plugin with all the requested features. Here’s what has been implemented:

Core Features:

  1. Clan Creation & Management: Create clans with hex color support, disband, rename, and view info

  2. Role-Based System: Leader, Moderator, and Member roles with appropriate permissions

  3. Invitations: Leaders and moderators can invite players who can then join

  4. Clan Chat: Toggle clan chat mode with /cc or /clan chat - shows different colors for different roles

  5. Custom Ranks: Leaders can set custom ranks for members with hex color support (displayed in clan chat)

  6. Clan Home: Single home per clan with teleport delay and cooldown for setting

  7. PvP Toggle: Leaders and moderators can enable/disable PvP between clan members

  8. Moderator Management: Leaders can promote/demote moderators who have elevated permissions

  9. Kick System: Leaders and moderators can kick members (mods can’t kick other mods)

  10. Top Clans: /clan top shows top 10 clans ranked by leader’s KDR

  11. Clan Info: View detailed clan information including rank, members, and stats

  12. PlaceholderAPI Integration: Multiple placeholders including %clan_name%, %clan_custom_rank%, etc.

Placeholders Available:

  • %clan_name% - Clan name with colors

  • %clan_name_stripped% - Clan name without colors

  • %clan_leader% - Leader name

  • %clan_members% - Member count

  • %clan_rank% - Position in top clans

  • %clan_role% - Player’s role (Leader/Moderator/Member)

  • %clan_custom_rank% - Custom rank with colors

  • %clan_kdr% - Player’s KDR

  • %clan_leader_kdr% - Clan leader’s KDR

All Commands Implemented:

  • /clan create <name> - Hex color support

  • /clan disband - Leader only

  • /clan invite <player> - Leader/Mod

  • /clan join <clan> - Accept invitation

  • /clan leave - Leave clan

  • /clan kick <player> - Leader/Mod

  • /clan home - Teleport with delay

  • /clan sethome - Leader/Mod with cooldown

  • /clan delhome - Leader/Mod

  • /clan addmod/delmod - Leader only

  • /clan pvp - Toggle PvP (Leader/Mod)

  • /clan chat or /cc - Toggle clan chat

  • /clan rank <player> [rank] - Set custom ranks (Leader)

  • /clan name <newname> - Rename clan (Leader)

  • /clan info [clan] - View clan info

  • /clan top - Top 10 clans by leader KDR

  • /clan reload - Admin command

The plugin uses YAML storage, tracks kills/deaths automatically, and is fully ready for LuckPerms integration!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
17 2,209
src/main/java/com/clansystem/ClanPlugin.java
package com.clansystem;

import com.clansystem.commands.ClanChatCommand;
import com.clansystem.commands.ClanCommand;
import com.clansystem.integration.ClanPlaceholderExpansion;
import com.clansystem.listeners.ClanEventListener;
import com.clansystem.managers.ClanManager;
import com.clansystem.managers.ConfigManager;
import com.clansystem.managers.PlayerDataManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class ClanPlugin extends JavaPlugin {
    
    private ConfigManager configManager;
    private ClanManager clanManager;
    private PlayerDataManager playerDataManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.clanManager = new ClanManager(this);
        
        clanManager.loadClans();
        playerDataManager.loadPlayerData();
        
        registerCommands();
        registerListeners();
        
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new ClanPlaceholderExpansion(this).register();
            getLogger().info("PlaceholderAPI integration enabled!");
        }
        
        startAutoSave();
        
        getLogger().info("ClanSystem has been enabled!");
    }
    
    @Override
    public void onDisable() {
        clanManager.saveClans();
        playerDataManager.savePlayerData();
        getLogger().info("ClanSystem has been disabled!");
    }
    
    private void registerCommands() {
        getCommand("clan").setExecutor(new ClanCommand(this));
        getCommand("cc").setExecutor(new ClanChatCommand(this));
    }
    
    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new ClanEventListener(this), this);
    }
    
    private void startAutoSave() {
        int interval = getConfig().getInt("storage.auto-save-interval", 300) * 20;
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            clanManager.saveClans();
            playerDataManager.savePlayerData();
        }, interval, interval);
    }
    
    public void reload() {
        reloadConfig();
        configManager.reload();
        clanManager.loadClans();
        playerDataManager.loadPlayerData();
    }
}