Robin Ton

Role: You are an expert Minecraft Plugin Developer specialized in Paper MC and Spigot API for Minecraft version 1.21.1 (and 1.21.x sub-versions). ​Task: Create a complete, fully functional, and production-ready Minecraft Paper/Spigot plugin named ClanSmpV1. ​Plugin Specifications & Requirements ​1. Clan Creation, Invites & Kill-Based Ranking System ​Team Creation & Invite Commands: ​/clanteam create <team_name>: Creates a new team (unranked initially). ​/clan invite <player>: Invites a player to join the team (Max 4 players per clan/team). ​/clan accept: Accepts a pending invite. ​Kill Progression System (Unlocking Clans): ​Teams accumulate total kills as a group. ​3 Kills: Team gets promoted to Clan Bronze. ​10 Kills: Team gets promoted to Clan Silver. ​15 Kills: Team gets promoted to Clan Gold. ​25 Kills: Team gets promoted to Clan Diamond. ​Solo / Clanless Player Rule: ​If a player is not in any clan, they can challenge and defeat an existing Clan Leader to take over their place as the new Clan Leader of that clan. ​2. Clan Hierarchy, Effects & Restrictions ​Clan Diamond (Aqua &b) ​Infinite Effects: Fire Resistance I, Strength II, Speed I ​Special Perk: Only players in Diamond Clan can equip and use Netherite Armor & Tools. ​Clan Gold (Gold &6) ​Infinite Effects: Fire Resistance I, Strength I, Speed I ​Equipment Limit: Diamond Tier max (Netherite usage cancelled/blocked). ​Clan Silver (Gray &7) ​Infinite Effects: Strength I, Speed I ​Equipment Limit: Diamond Tier max. ​Clan Bronze (Dark Red &4) ​Infinite Effects: Speed I ​Equipment Limit: Diamond Tier max. ​Netherite Protection Listener: If a non-Diamond player attempts to equip, hold, or use Netherite gear, cancel the event and notify the player in chat. ​3. PvP Rules & Friendly Fire ​Friendly Fire Disabled: Same clan members cannot damage/attack each other (EntityDamageByEntityEvent handling). ​Cross-Clan PvP Enabled: Players can freely fight members of other clans. ​4. Tablist & Nametag Formatting ​Display format in Tablist and above heads: [<Clan Name>] <Player Name> ​Apply corresponding clan colors to prefixes and player names. ​5. Leadership & Voting System ​Command: /vote <player> ​Members of a clan can vote for a teammate to become the Leader. ​When a player gets the majority vote, broadcast a screen Title & Subtitle to all players: ​Title: &e&lNEW CLAN LEADER ​Subtitle: &b<Player Name> &fis now the leader of &a<Clan Name>! ​6. Clan vs Clan (War System) & Clan Swap ​Command: /clan challenge <TargetClan> (Leader only) ​Command: /setclanspawn (Admin only: clansmp.admin permission) - Sets the official spawn location for clan battles. ​War Countdown: Once accepted, a 30-minute timer starts for both teams to reach the /setclanspawn location. ​Rank Swap Logic: ​If a lower-ranked clan defeats a higher-ranked clan in war: ​The lower clan gets promoted to the higher clan's rank. ​The defeated higher clan gets demoted to the lower clan's rank. ​Update all player effects, tablist colors, and Netherite permissions immediately upon rank swap. ​7. Technical Requirements ​Target Platform: Paper / Spigot 1.21.1. ​Provide clean, well-commented code across: ​plugin.yml ​config.yml ​Main plugin class (ClanSmpV1.java) ​Listeners (PvP/Friendly Fire, Netherite Guard, Kill Tracker, Effect Renewer, Join Listener) ​Command Classes (ClanCommand.java, VoteCommand.java, SetClanSpawnCommand.java).

Kodari AI
KodariOct 2 at 3:43 am 1

The generation was stopped before any content could be produced.

Robin Ton

Create a complete Minecraft Java plugin named ClanSmpV1.

Platform & Version

  • Minecraft: 1.21.11
  • Server software: Paper 1.21.11
  • Also maintain compatibility with Spigot 1.21.11 where possible.
  • Language: Java
  • Use modern Paper/Spigot APIs.
  • Plugin must be optimized, stable, and avoid unnecessary repeating tasks.
  • Plugin must support multiplayer servers.
  1. Four Clans

Create exactly four clans:

  1. Diamond Clan
  2. Gold Clan
  3. Silver Clan
  4. Bronze Clan

Each clan has its own color:

  • Diamond Clan → Aqua/Cyan
  • Gold Clan → Gold/Yellow
  • Silver Clan → Gray/White
  • Bronze Clan → Bronze/Dark Orange

The clan color must be visible in:

  • Tablist
  • Player name
  • Clan prefix
  • Clan-related messages
  • Scoreboard/team name where applicable

Example tablist:

"[Diamond] Robin"

The "[Diamond]" prefix and "Robin" should use the Diamond Clan color.

  1. Maximum Players

Each clan can have a maximum of 4 players.

  • Maximum 4 players per clan.
  • A player cannot belong to multiple clans simultaneously.
  • Prevent joining a full clan.
  • Display an appropriate message when a clan is full.
  1. Clan Powers

Players automatically receive permanent/infinite potion effects according to their clan.

Diamond Clan

  • Fire Resistance — Infinite
  • Strength II — Infinite
  • Speed I — Infinite

Gold Clan

  • Fire Resistance — Infinite
  • Strength I — Infinite
  • Speed I — Infinite

Silver Clan

  • Strength I — Infinite
  • Speed I — Infinite

Bronze Clan

  • Speed I — Infinite

Effects should automatically be applied when:

  • Player joins the server
  • Player joins a clan
  • Player changes clan
  • Player respawns
  • Player's effects are removed
  • Player reconnects

Do not constantly spam potion effects every tick.

  1. Armor & Tool Restrictions

Implement clan-based equipment restrictions.

Diamond Clan

Diamond Clan members can use:

  • Diamond armor
  • Netherite armor
  • Diamond tools
  • Netherite tools

Gold / Silver / Bronze

These clans can use equipment only up to Diamond tier.

They must NOT be able to use:

  • Netherite armor
  • Netherite tools

Prevent players from equipping or using restricted Netherite equipment.

Check:

  • Inventory
  • Armor slots
  • Main hand
  • Off-hand
  • Newly picked-up items
  • Crafted items
  • Items obtained from containers
  • Items obtained through commands where possible

If a player attempts to use restricted Netherite equipment, stop the action and send a clan restriction message.

  1. Clan Ranking System

Clan hierarchy:

Diamond > Gold > Silver > Bronze

The important mechanic is Clan vs Clan conquest.

A lower-ranked clan can challenge and defeat a higher-ranked clan.

Example:

Bronze defeats Diamond.

Then:

  • Bronze becomes Diamond
  • Former Diamond becomes Bronze
  • The other clans remain unchanged.

Another example:

Silver defeats Gold.

Then:

  • Silver becomes Gold
  • Gold becomes Silver

The system should effectively swap the ranks of the two clans.

The actual clan identity/player membership should remain intact, while the clan's rank/tier and associated powers/color/equipment permissions change.

Example:

Before:

  • Team A = Diamond
  • Team B = Bronze

After Team B defeats Team A:

  • Team B = Diamond
  • Team A = Bronze

All players immediately receive the powers and restrictions of their new rank.

  1. Clan Challenge Command

Create:

"/clan <clanname>"

Valid names:

  • "/clan diamond"
  • "/clan gold"
  • "/clan silver"
  • "/clan bronze"

This command is used to challenge another clan.

Only a clan leader should be able to initiate a clan-vs-clan challenge.

Example:

"/clan diamond"

If the player belongs to Silver Clan and targets Diamond Clan:

Send a challenge request to the Diamond Clan leader.

The target leader receives a clear message such as:

"Silver Clan has challenged your clan to a Clan War!"

Provide clickable Accept / Deny buttons if possible.

  1. Clan War Preparation

After a challenge is accepted:

  • Start a 30-minute preparation period.
  • Both clan leaders and members should receive notifications.
  • The target clan's leader must receive the location where the battle will happen.
  • The clan spawn/location should be configurable.

Create:

"/setclanspawn"

The command sets the clan-war spawn location to the command sender's current location.

Save the location in the plugin configuration.

The location must survive server restarts.

  1. Clan War

After the preparation period:

  • Both clans fight each other.
  • Track the participating players.
  • Prevent unrelated players from interfering where practical.
  • Display clear war announcements.

The plugin must determine which clan won.

The exact victory condition should be configurable.

Default victory condition:

A clan wins when all active members of the opposing clan are defeated/eliminated from the battle.

After the winning clan is determined:

  • Swap the ranks of the two clans.
  • Announce the result globally.
  • Update tablist prefixes/colors.
  • Update player powers.
  • Update equipment restrictions.
  • Save the new clan ranks.
  1. Clan Spawn

Command:

"/setclanspawn"

Permission:

"clansmp.admin"

Save:

  • World
  • X
  • Y
  • Z
  • Yaw
  • Pitch

Add a configurable teleport system for Clan War preparation.

If no clan spawn has been configured, display a helpful error message instead of crashing.

  1. Clan Leader Voting

Create:

"/vote <player>"

Players can vote for a player to become their clan leader.

Rules:

  • Player must be in the same clan as the voter.
  • Player being voted for must be in the same clan.
  • Prevent invalid votes.
  • Prevent players from voting for players outside their clan.
  • Store votes safely.
  • Make the voting system persistent where appropriate.

The player receiving the most votes becomes the clan leader.

When a new leader is elected, make a large server-wide announcement.

Example:

"[CLAN] Diamond Clan Leader: Robin"

Also display a large title/subtitle to players:

"CLAN LEADER"

"Robin"

Use Minecraft title APIs.

Handle ties using a configurable tie-breaking method.

  1. Clan Leader System

Every clan must have exactly one leader whenever possible.

The leader is responsible for:

  • Starting clan challenges
  • Accepting/denying clan challenges
  • Receiving war notifications
  • Managing clan-related actions

If the leader leaves the server permanently or leaves the clan, automatically start/trigger a new leader vote or select the next valid leader according to configuration.

  1. Commands

Implement at minimum:

"/clan <diamond|gold|silver|bronze>"

"/vote <player>"

"/setclanspawn"

Add useful administrative commands such as:

"/clansmp reload"

"/clansmp info"

"/clansmp setclan <player> <clan>"

"/clansmp remove <player>"

"/clansmp reset"

Protect admin commands using permissions.

  1. Permissions

Create permissions such as:

"clansmp.admin"

"clansmp.reload"

"clansmp.setclan"

"clansmp.setspawn"

Normal players must not have administrative permissions.

  1. Persistent Data

Do not store important clan data only in memory.

Save:

  • Player → clan
  • Clan → leader
  • Clan ranks
  • Voting data
  • Clan War state
  • Clan spawn
  • Configuration

Use YAML or another lightweight persistent storage system.

The data must survive:

  • Server restart
  • Plugin reload
  • Player reconnect
  1. Tablist

Use teams/prefixes or the appropriate modern API.

Example:

"[DIAMOND] Robin"

"[GOLD] Alex"

"[SILVER] Steve"

"[BRONZE] Sam"

Colors must update immediately whenever clan ranks change.

  1. Messages

Create configurable messages in:

"messages.yml"

Include messages for:

  • Clan joining
  • Clan full
  • Challenge sent
  • Challenge received
  • Challenge accepted
  • Challenge denied
  • War starting
  • War cancelled
  • War winner
  • Rank swap
  • Leader election
  • New leader
  • Restricted Netherite equipment
  • Invalid command
  • No permission
  • Clan spawn not configured

Use MiniMessage or another modern text API compatible with the target server version.

  1. Configuration

Create a clean:

"config.yml"

Include:

  • Clan names
  • Clan colors
  • Maximum players
  • Potion effects
  • Clan hierarchy
  • War preparation time
  • Clan spawn
  • Voting settings
  • Messages settings
  • Equipment restrictions
  • Debug mode

Do not hard-code values that should reasonably be configurable.

  1. Architecture

Use a clean object-oriented structure.

Suggested package:

"com.robins.clansmp"

Suggested classes:

  • "ClanSmpV1"
  • "ClanManager"
  • "Clan"
  • "ClanPlayer"
  • "ClanRankManager"
  • "ClanLeaderManager"
  • "ClanVoteManager"
  • "ClanWarManager"
  • "ClanChallengeManager"
  • "ClanSpawnManager"
  • "PotionManager"
  • "EquipmentRestrictionManager"
  • "TablistManager"
  • "MessageManager"
  • "DataManager"
  • "CommandManager"
  • "ClanCommand"
  • "VoteCommand"
  • "SetClanSpawnCommand"
  • "ClanSmpAdminCommand"
  • Event listeners for player join, quit, respawn, death, inventory, equipment, crafting, pickup, etc.

Use managers instead of putting all functionality into the main plugin class.

  1. Important Edge Cases

Handle:

  • Player disconnects during a war
  • Server restarts during a war
  • Clan becomes empty
  • Leader disconnects
  • Clan reaches 4-player limit
  • Invalid clan names
  • Challenge to own clan
  • Two clans challenging each other simultaneously
  • Challenge expires
  • War timeout
  • Player dies outside a war
  • Player changes rank during active effects
  • Netherite items already inside inventory
  • Reloading plugin
  • Missing configuration
  • Missing clan spawn

Never allow invalid states that could corrupt clan data.

  1. Final Deliverables

Generate a complete buildable project, not pseudocode.

Include:

  • "plugin.yml"
  • "config.yml"
  • "messages.yml"
  • Complete Java source code
  • Correct package structure
  • All required imports
  • Event listeners
  • Commands
  • Permissions
  • Persistent data system
  • Clan War system
  • Voting system
  • Tablist system
  • Potion system
  • Equipment restriction system
  • Build configuration

The final project should compile without errors for Paper 1.21.11 and should be designed to remain compatible with Spigot 1.21.11.

Do not leave TODO placeholders or incomplete methods.

Before providing the final code, check for:

  • API compatibility
  • Missing imports
  • Incorrect event names
  • Deprecated/removed APIs
  • Command registration errors
  • YAML configuration errors
  • Null pointer risks
  • Data persistence issues
  • Multiplayer race conditions

Provide the complete project in a structure that can be opened and built using a mobile coding environment such as CodeAssist.

Kodari AI
KodariOct 2 at 3:51 am 2
ClanSmpV1
A comprehensive clan management plugin for Minecraft Paper/Spigot 1.21.11. Features four color-coded clans (Diamond, Gold, Silver, Bronze) with max 4 players each, automatic potion effects per clan, equipment restrictions preventing Netherite for lower clans, clan ranking system with rank swapping, challenge commands with leader voting, 30-minute war preparation with configurable spawn, persistent data storage via YAML, tablist integration, and full admin commands. Includes voting system for clan leaders, configurable messages and settings, and handles edge cases like disconnects, restarts, and empty clans.
  1. Build the plugin foundation, configuration, persistence, clan model, and managers.

  2. Add clan, voting, spawn, and admin commands with leader/challenge flows.

  3. Add war, effects, tablist, equipment enforcement, and lifecycle listeners.

Created the ClanSmpV1 Gradle project for Java 21 and Paper 1.21.11, with Spigot-compatible Bukkit APIs.

It includes four persistent clan ranks, configurable effects and colors, clan joining/leaving, leader voting, clickable war challenges, preparation and battle handling, rank swaps, spawn persistence, friendly-fire prevention, and Netherite restrictions. Admin commands cover reload, info, membership changes, reset, and setting the war spawn.

Key commands: /clan join <rank>, /clan <rank>, /clan accept|deny, /clan leave, /vote <player>, and /clansmp <reload|info|setclan|remove|reset>. Data, voting, and active war state are stored in data.yml.

I did not run a build in this environment.

Robin Ton

Create a complete Minecraft Paper plugin named ClanSmpV1 for Minecraft 1.21.11.

The plugin must contain the existing Clan system plus a complete Duel / Party / Arena / Kit / Training Bot system.

PLATFORM

  • Minecraft: 1.21.11
  • Server: Paper 1.21.11
  • Try to maintain Spigot compatibility where the API allows.
  • Java plugin.
  • Must be optimized for multiplayer servers.
  • No TODO placeholders.
  • Complete buildable source code.

---

PART 1 — 1v1 DUEL SYSTEM

Create a 1v1 PvP duel system.

Commands

"/1v1 <player>"

or

"/duel <player>"

The player receives a duel request.

The target can:

  • Accept
  • Deny

Use clickable chat buttons if possible.

Example:

"Robin challenged Alex to a 1v1"

"[ACCEPT] [DENY]"

After accepting:

  1. Find an available arena.
  2. Select the selected kit.
  3. Teleport both players to the arena.
  4. Start countdown.
  5. Start the fight.

Countdown:

"3"

"2"

"1"

"FIGHT!"

---

PART 2 — PARTY SYSTEM

Implement a party system.

Commands

"/party create"

Creates a party.

"/party invite <player>"

Invites a player.

"/party join <player>"

Joins the player's party.

"/party leave"

Leaves the party.

"/party list"

Shows party members.

"/party fight"

Starts a party fight challenge.

Party Fight

A party can challenge another party.

Example:

Party A:

  • Robin
  • Alex
  • Steve
  • Sam

Party B:

  • Player1
  • Player2
  • Player3
  • Player4

Use:

"/party fight <party/player>"

The target party receives a challenge.

After accepting:

  • Find an available arena.
  • Select a kit.
  • Teleport both parties.
  • Start countdown.
  • Start PvP.

The system must support Party vs Party fights.

---

PART 3 — PARTY SIZE

Party size must be configurable.

Default:

"4 players"

Allow configuration such as:

party: max-size: 4

A party cannot exceed the configured maximum.

---

PART 4 — TRAINING BOT

Create a Training Bot system.

Command:

"/trainingbot"

or

"/duel bot"

The player can fight an automatic PvP bot.

The bot should:

  • Automatically move toward the player.
  • Attack the player.
  • Follow the player.
  • Try to maintain combat distance.
  • React when the player moves.
  • Continue fighting until the duel ends.

The bot should use the selected kit.

Example:

"/trainingbot"

→ Kit selection

→ Arena selection

→ Teleport player and bot

→ Countdown

→ Fight.

The bot must automatically disappear when the fight ends.

Do not create hundreds of unnecessary entities.

Clean the bot after:

  • Player wins
  • Player loses
  • Player disconnects
  • Duel is cancelled
  • Server/plugin reload

---

PART 5 — ARENA SYSTEM

Create an arena management system.

Arena creation

Commands:

"/arena create <name>"

Examples:

"/arena create 1"

"/arena create 2"

"/arena create 3"

"/arena create desert"

"/arena create castle"

Each arena must store:

  • Arena name
  • World
  • Position 1
  • Position 2
  • Spectator location
  • Spawn point for player/team 1
  • Spawn point for player/team 2
  • Arena region/boundary

Add appropriate setup commands, for example:

"/arena setspawn1 <arena>"

"/arena setspawn2 <arena>"

"/arena setpos1 <arena>"

"/arena setpos2 <arena>"

"/arena setspectator <arena>"

---

IMPORTANT ARENA RULE

An arena can only contain one active fight at a time.

If Arena 1 is currently being used:

Nobody else can start a fight in Arena 1.

The plugin must automatically choose another available arena.

Example:

Arena 1 → 1v1 running

Arena 2 → Party vs Party running

Arena 3 → Free

A new fight must use:

"Arena 3"

Never place two simultaneous fights into the same arena.

If all arenas are occupied:

"No arena is currently available. Please wait."

---

PART 6 — RANDOM ARENA SELECTION

When a fight starts, automatically select a random available arena.

Example:

Available:

  • Arena 1
  • Arena 3
  • Arena 5

Randomly choose one.

Do NOT choose arenas that currently have:

  • 1v1
  • Party fight
  • Training fight
  • Active reset
  • Another active match

---

PART 7 — ARENA RESET

During fights, players may:

  • Place blocks
  • Break blocks
  • Destroy terrain
  • Interact with blocks
  • Cause explosions where allowed

After the fight, the arena must be restored.

Command:

"/arena reset <arena>"

This manually resets the arena to its original state.

Example:

"/arena reset 1"

The arena returns to its original condition.

---

PART 8 — AUTOMATIC ARENA RESET

Every arena must automatically reset after 10 minutes.

Configuration:

arena: auto-reset-minutes: 10

The reset system should restore:

  • Broken blocks
  • Placed blocks
  • Changed blocks
  • Containers where applicable
  • Arena terrain

The reset must not affect areas outside the arena.

Do not reset an arena while a fight is currently active.

If an arena is active when its reset timer is reached:

  • Wait until the fight finishes.
  • Then reset the arena.

---

PART 9 — ARENA SNAPSHOT

When an arena is created/configured, save its original block state.

Before a fight:

"Original Arena"

During fight:

"Players modify arena"

After fight:

"Reset Arena"

The restoration system should efficiently restore only the arena's configured region.

Do not scan the entire Minecraft world unnecessarily.

---

PART 10 — KIT SYSTEM

Create a complete customizable Kit system.

Commands

"/kit create <name>"

"/kit edit <name>"

"/kit save <name>"

"/kit delete <name>"

"/kit list"

Example:

"/kit create diamond"

Then configure:

  • Armor
  • Main hand
  • Off-hand
  • Inventory
  • Enchantments
  • Potion effects
  • Food

Save the kit.

---

PART 11 — KIT SELECTION

Before starting:

  • 1v1
  • Party Fight
  • Party vs Party
  • Training Bot

Allow players to select the kit.

Example:

"/kit"

Open a GUI showing available kits.

Example:

DUEL KITS

"Diamond"

"Sword"

"Axe"

"UHC"

"Custom"

The selected kit is automatically given when the fight starts.

---

PART 12 — KIT GUI

Create a clean inventory GUI.

Display:

  • Kit name
  • Kit icon
  • Description
  • Available/unavailable status

Clicking a kit selects it.

The GUI should work for:

  • 1v1
  • Party fights
  • Training bot

---

PART 13 — KIT RESTORATION

When a player enters a fight:

Save their original:

  • Inventory
  • Armor
  • Off-hand
  • Potion effects
  • Food
  • Health
  • Location
  • Game mode

Give the selected kit.

After the fight:

Restore their previous state.

The player should return to their previous location.

---

PART 14 — DUEL STATE

Create a proper match system.

Possible states:

"WAITING"

"STARTING"

"FIGHTING"

"ENDING"

"RESETTING"

"FINISHED"

A player cannot join another fight while already participating in:

  • 1v1
  • Party fight
  • Training bot

Display:

"You are already in a match."

---

PART 15 — DEATH / VICTORY

When a player dies during a 1v1:

  • End the match.
  • Announce winner.
  • Announce loser.
  • Release the arena.
  • Restore player state.
  • Start arena reset process.

For Party vs Party:

The winning party is determined according to the configured team victory mode.

Default:

Last surviving party wins.

---

PART 16 — LEAVE / DISCONNECT

If a player disconnects during a fight:

Treat it as a loss after a configurable grace period.

For example:

duel: disconnect-grace-seconds: 10

If they don't return:

  • Opponent/team wins.
  • Match ends.
  • Arena is released.
  • Player state is restored if possible.

---

PART 17 — SPECTATOR MODE

After dying, optionally allow players to spectate the fight.

Example:

"/spectate <match>"

Spectators:

  • Cannot damage players.
  • Cannot modify blocks.
  • Cannot interfere.
  • Cannot pick up items.

After the fight:

Teleport spectators back.

---

PART 18 — ARENA PROTECTION

Only active fighters should be allowed to modify an active arena.

Prevent outside players from:

  • Breaking blocks
  • Placing blocks
  • Entering the arena
  • Interfering with fights
  • Attacking fighters

Unless they are valid participants/spectators.

---

PART 19 — CLAN INTEGRATION

The existing ClanSmpV1 clan system must remain.

The duel system must work independently from Clan Wars.

Players can participate in:

  • Clan War
  • 1v1
  • Party Fight
  • Training Bot

But a player already participating in a Clan War cannot enter a normal 1v1/party fight.

Likewise, players currently in an active duel cannot start a Clan War.

---

PART 20 — ADMIN COMMANDS

Add:

"/arena create <name>"

"/arena delete <name>"

"/arena list"

"/arena reset <name>"

"/arena setspawn1 <name>"

"/arena setspawn2 <name>"

"/arena setpos1 <name>"

"/arena setpos2 <name>"

"/arena setspectator <name>"

"/kit create <name>"

"/kit edit <name>"

"/kit save <name>"

"/kit delete <name>"

"/clansmp reload"

Protect these using:

"clansmp.admin"

---

PART 21 — CONFIGURATION

Create a configurable "config.yml".

Example:

party: max-size: 4

duel: countdown: 3 disconnect-grace-seconds: 10

arena: auto-reset-minutes: 10 random-selection: true

training-bot: enabled: true

kits: enabled: true

---

PART 22 — DATA STORAGE

Persist:

  • Arenas
  • Arena locations
  • Arena regions
  • Arena snapshots/configuration
  • Kits
  • Kit inventories
  • Clan data
  • Clan leaders
  • Clan ranks
  • Player data

Data must survive server restart.

---

PART 23 — PERFORMANCE

The plugin must be optimized.

Do NOT:

  • Scan entire worlds repeatedly.
  • Run expensive block scans every tick.
  • Create unnecessary entities.
  • Create unnecessary asynchronous tasks.
  • Apply potion effects every tick.

Use efficient Bukkit/Paper APIs.

Arena reset should only operate on the configured arena region.

Training bots should use efficient AI/task handling.

---

PART 24 — COMPLETE PROJECT

Provide a complete buildable project containing:

  • "plugin.yml"
  • "config.yml"
  • "messages.yml"
  • Java source files
  • Commands
  • Event listeners
  • Managers
  • Arena system
  • Arena reset system
  • Kit system
  • Kit GUI
  • 1v1 system
  • Party system
  • Party vs Party system
  • Training bot
  • Spectator system
  • Clan system
  • Clan War system
  • Persistent storage
  • Permissions

Recommended package:

"com.robins.clansmp"

Recommended architecture:

ClanSmpV1 ├── ClanManager ├── ClanWarManager ├── ClanLeaderManager ├── DuelManager ├── PartyManager ├── MatchManager ├── ArenaManager ├── ArenaResetManager ├── KitManager ├── KitGUI ├── TrainingBotManager ├── SpectatorManager ├── PlayerStateManager ├── EquipmentRestrictionManager ├── TablistManager ├── DataManager ├── MessageManager └── CommandManager

The final plugin must compile for Paper 1.21.11 and should work on Spigot 1.21.11 wherever compatible.

Do not provide pseudocode.

Do not leave incomplete methods.

All commands, listeners, GUIs, persistence, arena locking, random arena selection, automatic reset, kit management, party fights, 1v1 and training bot functionality must be implemented.

Kodari AI
KodariOct 2 at 5:11 am 7
  1. Inspect the existing project and preserve its Clan/Clan War system.

  2. Build arena, snapshot/reset, and persistence foundations.

  3. Add kits, player-state restoration, and kit selection GUI.

  4. Implement duels, parties, training bots, spectators, and protection.

  5. Wire commands/config/messages, then check cross-file consistency.

  1. Arena foundation added: persisted arena regions/spawns, exclusive random arena locking, bounded snapshots, container inventories, and deferred automatic reset. Next is kit persistence and selection.

  1. Kits now persist inventory, armor, off-hand, food, and potion effects; /kit opens a selectable GUI, and admin kit management is registered. Next: match/player-state foundations and Clan War conflict checks.

  1. The match foundation and 1v1 flow are in place: requests/acceptance, countdown, kit application, state restoration, death/disconnect handling, Clan War exclusion, and active-arena protection. Next: arena setup commands and party challenges.

  1. Added /arena setup/reset controls and party creation, invitations, leadership handoff, size limits, party challenges, and team-vs-team matches. Next: training-bot lifecycle and spectator handling.

  1. Training uses one kit-equipped, AI-controlled zombie per match and removes it on every finish path; spectators are isolated and restored, and /trainingbot, /duel bot, and /spectate are registered. Next: tighten Clan War exclusion and remaining cross-system edge cases.

Expanded the existing ClanSmpV1 project while preserving its Clan and Clan War data and commands.

  • Added persisted arena setup, exclusive arena locking, random selection, bounded block/container snapshots, manual reset, and deferred 10-minute auto-reset.

  • Added 1v1 requests with clickable accept/deny, countdowns, match states, death/disconnect handling, and player-state restoration.

  • Added parties with configurable size, invites, leadership handoff, and party-vs-party matches.

  • Added customizable kits with saved equipment, inventory, food, and potion effects, plus a selection GUI.

  • Added kit-equipped training bots with cleanup, match spectators, arena protection, and Clan War/duel conflict checks.

  • Registered the new commands and added the requested configuration settings.

The source contains no TODO or placeholder markers. I did not run a local build.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
45 3,996
src/main/java/com/robins/clansmp/ClanSmpV1.java
package com.robins.clansmp;

import com.robins.clansmp.command.ClanCommand;
import com.robins.clansmp.command.ClanSmpAdminCommand;
import com.robins.clansmp.command.KitCommand;
import com.robins.clansmp.command.DuelCommand;
import com.robins.clansmp.command.ArenaCommand;
import com.robins.clansmp.command.PartyCommand;
import com.robins.clansmp.command.TrainingBotCommand;
import com.robins.clansmp.command.SpectateCommand;
import com.robins.clansmp.command.SetClanSpawnCommand;
import com.robins.clansmp.command.VoteCommand;
import com.robins.clansmp.listener.ClanListener;
import com.robins.clansmp.listener.EquipmentRestrictionListener;
import com.robins.clansmp.listener.MatchListener;
import com.robins.clansmp.gui.KitGUI;
import com.robins.clansmp.manager.ClanManager;
import com.robins.clansmp.manager.ClanSpawnManager;
import com.robins.clansmp.manager.ClanWarManager;
import com.robins.clansmp.manager.ArenaManager;
import com.robins.clansmp.manager.ArenaResetManager;
import com.robins.clansmp.manager.KitManager;
import com.robins.clansmp.manager.MatchManager;
import com.robins.clansmp.manager.DuelManager;
import com.robins.clansmp.manager.PartyManager;
import com.robins.clansmp.manager.TrainingBotManager;
import com.robins.clansmp.manager.SpectatorManager;
import com.robins.clansmp.manager.DataManager;
import com.robins.clansmp.manager.EquipmentRestrictionManager;
import com.robins.clansmp.manager.MessageManager;
import com.robins.clansmp.manager.PotionManager;
import com.robins.clansmp.manager.TablistManager;
import com.robins.clansmp.manager.VoteManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public final class ClanSmpV1 extends JavaPlugin {
    private DataManager dataManager;
    private MessageManager messages;
    private ClanManager clanManager;
    private ClanSpawnManager clanSpawnManager;
    private PotionManager potionManager;
    private TablistManager tablistManager;
    private EquipmentRestrictionManager equipmentRestrictionManager;
    private VoteManager voteManager;
    private ClanWarManager clanWarManager;
    private ArenaManager arenaManager;
    private ArenaResetManager arenaResetManager;
    private KitManager kitManager;
    private KitGUI kitGUI;
    private MatchManager matchManager;
    private DuelManager duelManager;
    private PartyManager partyManager;
    private TrainingBotManager trainingBotManager;
    private SpectatorManager spectatorManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        dataManager = new DataManager(this);
        messages = new MessageManager(this);
        clanManager = new ClanManager(this, dataManager);
        clanSpawnManager = new ClanSpawnManager(this);
        potionManager = new PotionManager(this);
        tablistManager = new TablistManager(this);
        equipmentRestrictionManager = new EquipmentRestrictionManager(this);
        voteManager = new VoteManager(this);
        clanWarManager = new ClanWarManager(this);
        arenaManager = new ArenaManager(this, dataManager);
        arenaResetManager = new ArenaResetManager(this, arenaManager);
        kitManager = new KitManager(this, dataManager);
        kitGUI = new KitGUI(this);
        trainingBotManager = new TrainingBotManager(this);
        spectatorManager = new SpectatorManager(this);
        matchManager = new MatchManager(this);
        duelManager = new DuelManager(this);
        partyManager = new PartyManager(this);

        Bukkit.getPluginManager().registerEvents(new ClanListener(this), this);
        Bukkit.getPluginManager().registerEvents(new EquipmentRestrictionListener(this), this);
        Bukkit.getPluginManager().registerEvents(kitGUI, this);
        Bukkit.getPluginManager().registerEvents(new MatchListener(this), this);
        getCommand("clan").setExecutor(new ClanCommand(this));
        getCommand("vote").setExecutor(new VoteCommand(this));
        getCommand("setclanspawn").setExecutor(new SetClanSpawnCommand(this));
        getCommand("clansmp").setExecutor(new ClanSmpAdminCommand(this));
        getCommand("kit").setExecutor(new KitCommand(this));
        getCommand("duel").setExecutor(new DuelCommand(this));
        getCommand("arena").setExecutor(new ArenaCommand(this));
        getCommand("party").setExecutor(new PartyCommand(this));
        getCommand("trainingbot").setExecutor(new TrainingBotCommand(this));
        getCommand("spectate").setExecutor(new SpectateCommand(this));

        for (Player player : Bukkit.getOnlinePlayers()) refreshPlayer(player);
        getLogger().info("ClanSmpV1 enabled with four persistent clan ranks.");
    }

    @Override
    public void onDisable() {
        if (matchManager != null) matchManager.shutdown();
        if (trainingBotManager != null) trainingBotManager.shutdown();
        if (clanManager != null) clanManager.save();
        if (dataManager != null) dataManager.save();
    }

    public void refreshPlayer(Player player) {
        if (tablistManager != null) tablistManager.apply(player);
        if (potionManager != null) potionManager.apply(player);
        if (equipmentRestrictionManager != null) equipmentRestrictionManager.enforce(player, false);
    }

    public void refreshAllPlayers() {
        if (tablistManager != null) tablistManager.refreshTeams();
        for (Player player : Bukkit.getOnlinePlayers()) refreshPlayer(player);
    }

    public void reloadPluginSettings() {
        reloadConfig();
        messages.reload();
        tablistManager.refreshTeams();
        refreshAllPlayers();
    }

    public DataManager getDataManager() { return dataManager; }
    public MessageManager getMessages() { return messages; }
    public ClanManager getClanManager() { return clanManager; }
    public ClanSpawnManager getClanSpawnManager() { return clanSpawnManager; }
    public PotionManager getPotionManager() { return potionManager; }
    public TablistManager getTablistManager() { return tablistManager; }
    public EquipmentRestrictionManager getEquipmentRestrictionManager() { return equipmentRestrictionManager; }
    public VoteManager getVoteManager() { return voteManager; }
    public ClanWarManager getClanWarManager() { return clanWarManager; }
    public ArenaManager getArenaManager() { return arenaManager; }
    public ArenaResetManager getArenaResetManager() { return arenaResetManager; }
    public KitManager getKitManager() { return kitManager; }
    public KitGUI getKitGUI() { return kitGUI; }
    public MatchManager getMatchManager() { return matchManager; }
    public DuelManager getDuelManager() { return duelManager; }
    public PartyManager getPartyManager() { return partyManager; }
    public TrainingBotManager getTrainingBotManager() { return trainingBotManager; }
    public SpectatorManager getSpectatorManager() { return spectatorManager; }
}