salion2X
📎 1 file 2,828 chars
📄
pasted-code-1792397891688.txt
txt 65 lines
▶
You are an expert Minecraft Java Plugin Developer. I need a complete, fully functional Paper/Spigot Plugin written in Java for Minecraft 1.21.1 (using the latest Spigot/Paper API). The plugin is for a custom gamemode called "IslandWar" (Island Co-Op to Deathmatch).

🎮 Game Concept & Core Mechanics:
Preparation Phase (30 Minutes - Configurable in config.yml):

Two teams (RED and BLUE) spawn on two distant separate islands upon starting.

PvP and player-vs-player damage are completely disabled during this phase.

Countdown timer broadcasts remaining time in chat and plays a block.note_block.pling sound at key milestones (10m, 5m, 1m, 30s, 5s–1s).

PvP Phase & Center Island:

When the preparation timer ends, PvP is globally enabled.

Play an Ender Dragon growl sound (Sound.ENTITY_ENDER_DRAGON_GROWL) to all players.

Programmatically generate a Center Island (a circular stone/cobblestone platform of radius 10 with stone brick walls at the configured center location) using Bukkit Block API.

Shrink the WorldBorder from an initial size (e.g., 1500 blocks) down to the center island (30 blocks) over 10 minutes (600 seconds) using WorldBorder Bukkit API.

Elimination & Win Condition:

When a player dies during the PvP phase, set their Gamemode to Spectator (GameMode.SPECTATOR).

Track active living players per team continuously.

When one team is completely eliminated, announce the winning team, play a victory sound (Sound.UI_TOAST_CHALLENGE_COMPLETE), broadcast win messages, and stop the match after 5 seconds, resetting the border.

📦 Custom Loot Chest System (25 Unique Variations):
Provide an admin command /iw getchests that places 25 distinct custom-named chest items into the admin's inventory across 5 tiers:

Bad Chest (Types 1 to 5)

Acceptable Chest (Types 1 to 5)

Medium Chest (Types 1 to 5)

Epic Chest (Types 1 to 5)

Legendary Chest (Types 1 to 5)

Listen to BlockPlaceEvent. When a chest with one of these custom names is placed, identify its tier/type and automatically fill the placed chest's inventory with rich pre-defined loot (armor, weapons with enchantments, golden apples, potions, blocks, and food).

⚙️ Commands & Permissions:
/iw help - Displays help menu.

/iw setspawn  - Sets team spawn points.

/iw setcenter - Sets the center point for the final island and WorldBorder origin.

/iw start - Starts the match sequence.

/iw teststart - Fast-forwards preparation time to 5 seconds for fast testing.

/iw stop - Forcefully stops the game and resets borders.

/iw getchests - Gives all 25 custom loot chests.

Permission node for admin commands: islandwar.admin

🛠️ Technical Requirements:
Must target Java 21 and Paper/Spigot API 1.21.1.

Use clean code architecture with proper Event Listeners, CommandExecutors/TabCompleters, and a config.yml for configurable values.
Kodari AI
KodariOct 19 at 8:28 am 2
IslandWar
IslandWar is a competitive two-team gamemode plugin featuring a 30-minute preparation phase with disabled PvP, followed by a deathmatch phase with a shrinking world border and procedurally generated center island. It includes team spawn management, spectator conversion on death, win detection, and a 25-variant custom loot chest system across five tiers with enchanted gear, potions, and resources. Admin commands handle match control, spawn configuration, and chest distribution.
  1. Add the Paper 1.21.1 / Java 21 project setup and configurable match settings.

  2. Implement match phases, team assignment, countdown, island generation, border control, and elimination handling.

  3. Add /iw admin commands and the 25 tagged loot chests with tiered loot.

Created the Java 21 / Paper 1.21.1 IslandWar plugin with configurable preparation and border timers, automatic team assignment, PvP phase transitions, center-island generation, elimination tracking, and border restoration.

Admin commands use islandwar.admin. Set both team spawns and the center in the same world with /iw setspawn red, /iw setspawn blue, and /iw setcenter; then use /iw start. /iw teststart sets an active preparation countdown to five seconds, and /iw getchests grants all 25 tiered loot chests.

salion2X

I didn't like that structure in the middle. I don't want a fighting arena; I want a circle of grass blocks with a diameter of 15 blocks.

Kodari AI
KodariOct 19 at 9:57 am 1

I’ll replace the stone platform and walls with a circular, 15-block-wide layer of grass blocks.

Updated the center island to a circular layer of grass blocks with a 15-block diameter. Removed the stone platform and walls.

salion2X

I want to be able to test it on my own without someone to identify any bugs, and I also want that center island to automatically disappear if the game is paused or ends.

Kodari AI
KodariOct 20 at 11:54 am 1
  1. Make solo testing practical by checking how match startup and team assignment currently behave.

  2. Track the generated center island and remove it when the match pauses or ends.

  1. Solo testing: /iw start now works with one online player. The player counts as both teams so the match won’t end immediately; /iw teststart still fast-forwards preparation.

  2. Pause and cleanup: Added /iw pause and /iw resume. Pausing removes the center island and restores the blocks that were there before it was generated. Resuming restores the island; stopping or ending the match removes it as well.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
7 964
src/main/java/com/kodari/islandwar/IslandWarPlugin.java
package com.kodari.islandwar;

import com.kodari.islandwar.command.IslandWarCommand;
import com.kodari.islandwar.game.MatchManager;
import com.kodari.islandwar.loot.LootChestManager;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class IslandWarPlugin extends JavaPlugin {
    private MatchManager matchManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        matchManager = new MatchManager(this);
        LootChestManager lootChestManager = new LootChestManager(this);
        Bukkit.getPluginManager().registerEvents(matchManager, this);
        Bukkit.getPluginManager().registerEvents(lootChestManager, this);

        PluginCommand command = getCommand("iw");
        if (command == null) {
            throw new IllegalStateException("The /iw command is missing from plugin.yml");
        }
        IslandWarCommand executor = new IslandWarCommand(this, matchManager, lootChestManager);
        command.setExecutor(executor);
        command.setTabCompleter(executor);
    }

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