Bartek
📎 1 file 1,975 chars
📄
pasted-code-1794417803304.txt
txt 55 lines
▶
Update the Minecraft Paper 1.21.4 plugin called BoysVsGirls.

GAME MODE:
Wool Box – Boys vs Girls.

TEAMS:
1. Boys – receive only BLUE WOOL.
2. Girls – receive only PINK WOOL.

INVENTORY:
- Players receive a full inventory of their team's wool.
- Wool automatically refills when players use it.
- Boys cannot receive pink wool.
- Girls cannot receive blue wool.

BOX SELECTION:
- Add the /wand command to give administrators an IRON AXE.
- Left-click selects position 1.
- Right-click selects position 2.
- The selection creates a cuboid region.
- Add /setboxboys and /setboxgirls commands to save the selected regions.
- Save the original blocks inside both boxes.

WINNING SYSTEM:
- Boys must completely fill their box with BLUE WOOL.
- Girls must completely fill their box with PINK WOOL.
- The plugin must continuously check whether the entire required region is filled with the correct wool.
- When a team completely fills its box, that team immediately wins the round.
- Display a large title in the middle of the screen:
  BOYS TEAM WON!
  or
  GIRLS TEAM WON!
- Add victory sounds and fireworks.
- Automatically reset both boxes to their original state after a victory.
- Give players their team wool again and prepare the next round.

SPAWNS:
- /setspawn – set the main spawn.
- /setspawnboys – set the boys' spawn.
- /setspawngirls – set the girls' spawn.
- After death, teleport players to their team's spawn.

ADDITIONAL FEATURES:
- Save all data after server restarts.
- Prevent block destruction outside the game rules.
- Restrict administrator commands to authorized players.
- All in-game messages must be in English.
- Fully compatible with Paper 1.21.4.
- No compilation errors.
- Generate all required Java files, plugin.yml, config.yml and a working JAR file.

IMPORTANT:
The box reset must restore the exact original blocks, not replace the entire region with air.

Make the plugin complete, optimized and ready to use on a Minecraft Paper 1.21.4 server.
Kodari AI
KodariNov 11 at 5:26 pm 2
WoolBoxBattle
A competitive Minecraft Paper 1.21.4 team minigame plugin where Boys and Girls race to fill their designated wool boxes. Administrators use a wand tool to select cuboid regions, save them as team boxes, and set spawn points. Players receive unlimited team-colored wool that auto-refills, with strict color restrictions preventing cross-team use. The plugin continuously monitors box completion, declaring victory with titles, sounds, and fireworks when a team fully fills their region. After each round, boxes automatically restore to their exact original blocks and players are re-equipped for the next match. Features persistent data storage, death respawn teleportation, block protection, and permission-based admin commands.
  1. Create the Paper 1.21.4 plugin structure and configuration.

  2. Add persistent team, selection, box snapshot/reset, spawn, and round logic.

  3. Register protected gameplay listeners and the requested admin commands.

Created the BoysVsGirls plugin with persistent, balanced team assignment; team-only wool inventories; protected box placement and breaking; saved cuboid block snapshots; spawn and respawn handling; and automatic victory titles, sound, fireworks, and box resets. Admins can assign a player with /bvgteam <player> <boys|girls>.

Setup: use /wand to select each box, then run /setboxboys and /setboxgirls. Set spawns with /setspawn, /setspawnboys, and /setspawngirls.

To build and download the JAR in Kodari:

  1. Click Compile in the top bar (on phone: ⋮ → Compile Project).

  2. Click Compile in the window.

  3. When it succeeds, click Download on the build.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
11 899
src/main/java/com/kodari/boysvsgirls/BoysVsGirlsPlugin.java
package com.kodari.boysvsgirls;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public final class BoysVsGirlsPlugin extends JavaPlugin {
    private GameManager gameManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        gameManager = new GameManager(this);
        gameManager.load();

        SelectionListener selectionListener = new SelectionListener(this);
        getServer().getPluginManager().registerEvents(selectionListener, this);
        getServer().getPluginManager().registerEvents(new GameListener(this, gameManager), this);

        AdminCommand adminCommand = new AdminCommand(gameManager, selectionListener);
        for (String commandName : new String[]{"wand", "setboxboys", "setboxgirls", "setspawn",
                "setspawnboys", "setspawngirls", "bvgteam"}) {
            getCommand(commandName).setExecutor(adminCommand);
        }

        for (Player player : Bukkit.getOnlinePlayers()) {
            gameManager.handleJoin(player);
        }
        getLogger().info("BoysVsGirls enabled.");
    }

    @Override
    public void onDisable() {
        if (gameManager != null) {
            gameManager.stop();
        }
        saveConfig();
    }
}