PRIMORDIUM

Develop a Minecraft plugin that generates a battle royale-style world featuring diverse biomes, stunning landscapes, and intricately designed locations including lush forests, houses with loot chests, and strategic vantage points. Ensure the world generation is compatible with Minecraft version 1.21.11, and include customizable settings for loot distribution, player spawn points, and game mechanics like shrinking play zones and dynamic event triggers.

Kodari AI
KodariNov 10 at 10:36 pm 3
BattleRoyaleWorldGenerator
Generates a battle royale-style Minecraft world with diverse biomes, lush forests, loot-filled houses, and strategic vantage points. Compatible with Minecraft 1.21.11, featuring customizable loot distribution, player spawn points, shrinking play zones, and dynamic event triggers. Uses a GUI-based configuration system for adjusting game mechanics, world generation parameters, and loot tables. Implements a centralized manager for world generation, spawn point selection, and zone shrinking logic, with event-driven gameplay triggers for an immersive battle royale experience.

I’ll use Minecraft’s native terrain generation for the biomes and landscapes, then add configurable locations, loot, spawns, a shrinking border, and timed events.

Created the battle royale world plugin with native terrain, generated houses and lookout towers, configurable loot and spawns, a shrinking border, and timed supply drops.

Use /brworld setspawn to add spawn points and /brworld start to begin with players already in the arena world. Other controls are /brworld stop, /brworld event, and /brworld status.

The plugin provides arena mechanics, but does not yet manage eliminations or declare a winner.

PRIMORDIUM
📎 1 file 11,777 chars
📄
pasted-code-1794352456024.txt
txt 526 lines
▶
# KODARI AI — COMPLETE MINECRAFT BATTLE ROYALE MINIGAME PLUGIN

## MAIN OBJECTIVE

Develop a complete, standalone Minecraft Battle Royale minigame plugin for Minecraft Java Edition 1.21.11.

**IMPORTANT: THIS IS ONLY A BATTLE ROYALE MINIGAME PLUGIN. NOT A COMPLETE MINECRAFT SERVER SYSTEM.**

Do not create a lobby system, Bedwars, Skywars, server-wide cosmetics, global economy, or unrelated features.

The plugin must manage the entire Battle Royale experience, from players joining an arena until a winner is declared and the arena resets.

You must actually write the Java code, create the project, implement all features, compile the plugin, and deliver a functional `.jar` file.

Use a compatible Paper API after verifying version support.

You do not have access to my existing server files, MoggMC-Cache, or Hoplite. Do not depend on them.

I will provide the Battle Royale map separately. Do not generate a new world or build the map.

---

# 1. BATTLE ROYALE ARENA SYSTEM

Create a complete arena management system supporting multiple Battle Royale matches.

Each arena must have:

- Unique arena ID and name.
- Configurable world.
- Player capacity.
- Minimum players.
- Waiting queue.
- Starting countdown.
- Individual starting cages.
- Match timer.
- Alive player tracking.
- Kill tracking.
- Spectator mode.
- Feast events.
- Mini-Feast events.
- Circular border.
- Victory detection.
- Automatic match reset.

Match states:

WAITING → STARTING → IN_GAME → ENDING → RESETTING.

Multiple arenas must operate independently.

Players must be able to join, leave, die, disconnect, and spectate without causing errors.

---

# 2. STARTING CAGES

Players must spawn inside individual cages before a match begins.

Requirements:

- Configurable cage coordinates.
- Proper player positioning.
- Countdown protection.
- Automatic release when the countdown finishes.
- No backward knockback.
- No teleportation glitches.
- No players getting stuck inside cages.

Create visually appealing cage designs.

Support a hanging decorative flag with animation, positioned correctly without clipping through the player.

---

# 3. BATTLE ROYALE HUD

Implement a custom Battle Royale HUD displaying:

- Arena name.
- Kills.
- Players alive.
- Remaining match time.

The HUD must update in real time.

Create a minimap or map interface that:

- Does not disappear randomly.
- Does not require a physical map item.
- Does not occupy the main hand or offhand.
- Does not overlap the scoreboard.

Center all HUD elements correctly.

Disable Locator XP Bar player-head indicators during matches.

---

# 4. KILL SYSTEM

Create a reliable elimination system.

When a player dies:

- Register the elimination.
- Credit the kill to the correct player.
- Update statistics.
- Update the number of surviving players.
- Display a centered Killshot notification.
- Move the eliminated player into spectator mode.

When only one player remains alive, immediately declare that player the winner.

**CRITICAL: THE MATCH MUST NEVER CONTINUE INDEFINITELY AFTER THE SECOND-TO-LAST PLAYER DIES.**

---

# 5. LOOT SYSTEM

Create a randomized chest loot system.

Requirements:

- Configurable item probabilities.
- Balanced weapons and armor.
- Different loot rarities.
- Random chest contents.
- Automatic chest filling when a match begins.

Diamond swords and diamond armor must not be excessively common.

Special items obtained through the Recipe Book must never appear inside normal chests.

---

# 6. MAIN FEAST

Create a complete Feast system.

The main Feast will be located at a medieval tower on my existing map.

**DO NOT BUILD THE TOWER.**

Instead, allow administrators to configure:

- Feast location.
- Feast chest positions.
- Feast activation timer.
- Feast loot.
- Protected Feast chest area.

The Feast chests must be located outside the tower.

Do not modify the terrain unnecessarily.

---

# 7. MINI-FEASTS

Implement Mini-Feast events.

They must:

- Spawn at appropriate locations.
- Avoid trees.
- Avoid rooftops.
- Avoid houses and other structures.
- Never destroy important map builds.
- Contain configurable loot.

Allow Staff members to set Mini-Feast locations manually.

---

# 8. CIRCULAR BORDER

Create a functional Battle Royale border.

Requirements:

- Circular shape.
- Smooth shrinking.
- Configurable center.
- Configurable starting radius.
- Configurable shrinking phases.
- Damage to players outside the border.
- Correct visual representation.

**DO NOT USE A SQUARE BORDER AS A REPLACEMENT FOR THE REQUESTED CIRCULAR BORDER.**

---

# 9. EXCLUSIVE BATTLE ROYALE WEAPONS

Implement these special weapons.

All special abilities must consume weapon durability.

## RUPTURE

Right-click:

- Summon lightning rain.
- Apply Slowness.
- Apply Darkness.
- Deal 2.5 damage over 2.78 seconds.
- Damage nearby enemies within the ability's range.
- Never affect the weapon owner.

## HUNTER'S BOW

Normal attacks:

- Fire arrows with randomized negative effects.
- Effects may vary depending on the amount of regular arrows obtained.

Right-click:

- Throw the bow like a boomerang.
- Deal 1 heart of damage.
- Return the bow to its owner.
- Cooldown: 10 seconds.

## CELESTIAL FAN

Left-click:

- Release a wind charge.
- Push enemies away.
- Cooldown: 10 seconds.

Right-click:

- Create a 5 × 5 block levitation zone.
- Duration: 10 seconds.
- Wind charge and levitation particles.
- Cooldown: 50 seconds.

## TRIDENT OF THE TIDES

Default:

- Loyalty-style returning behavior.

Left-click:

- Execute a dash similar to the SpearMace.
- Do not require Lunge.
- Play a water-trident animation.

## TWILIGHT SCEPTER

Left-click:

- Shoot Ghast-style fireballs.
- Cooldown: 5 seconds.

Special ability:

- Perform a Warden sonic boom attack.
- Include matching particles and damage.
- Cooldown: 15 seconds.

## SCULK BLADE

Crafting recipe:

- 1 Diamond Sword.
- 1 Twilight Scepter.
- 1 Sculk Shrieker.

Left-click:

- Apply Blindness for 5 seconds.

Right-click:

- Summon an allied Warden.
- The Warden protects its owner.
- It attacks enemies.
- It despawns after 3 minutes.
- Cooldown: 120 seconds.

### EXCLUDED ITEMS

Do not include Glacial Heart.

Do not include Abyss Blade in Battle Royale.

---

# 10. SPECIAL BATTLE ROYALE ARMOR

## WIND STEPS

Preserve the Wind Steps enchantment behavior and create a properly functioning special equipment item.

## MYSTIC DRAGON ARMOR

Create a complete special armor set.

When the entire set is equipped:

- Repel incoming projectiles.
- Reflect half of significantly high incoming damage back to the attacker.

Support optional custom resource-pack models.

---

# 11. BATTLE ROYALE GAMEPLAY RULES

- Allow players to drop items normally.
- Allow mining in permitted areas.
- Do not automatically regenerate or replace my custom Battle Royale world.
- Disable natural hostile mob spawning inside Battle Royale arenas.
- Allow only the allied Warden summoned by the Sculk Blade.

---

# 12. BATTLE ROYALE COSMETICS

Create a cosmetic selection menu available before a Battle Royale match begins.

The menu must support:

- Victory animations.
- Kill animations.
- Projectile particles.
- Pets during matches.

Provide a cosmetic selector in the waiting player's hotbar.

This must be a Battle Royale-specific system, not a server-wide cosmetics platform.

---

# 13. VICTORY ANIMATIONS

Create four victory animations.

**1. Warden Biome Transformation**

Transform the arena's blocks into Warden-themed blocks.

**2. TNT Rain**

TNT falls from the sky and explodes across the arena.

**3. Ender Dragon Ride**

The winner rides an Ender Dragon.

**4. Flying Pig**

The winner rides a flying pig that leaves colorful stained-glass trails.

Any destructive animation must be reversible when the arena resets.

---

# 14. KILL ANIMATIONS

Create three custom elimination animations.

**1. Exploding Head**

The eliminated player's head flies into the air, emits firework particles, and explodes into fireworks.

**2. Fire Tornado**

A tornado made of fire and lava particles appears at the elimination location.

**3. Witch and Lava**

A witch appears, laughs, and the ground visually transforms into lava.

These effects must not interrupt match progression.

---

# 15. BATTLE ROYALE STATISTICS

Track and save:

- Kills.
- Final Kills.
- Wins.
- Battle Royale levels.

Provide Battle Royale leaderboards for:

- TOP KILLS.
- TOP FINAL KILLS.
- TOP WINS.
- TOP LEVELS.

Do not create a global server ranking or economy system.

All statistics must belong exclusively to Battle Royale.

---

# 16. BATTLE ROYALE COMMANDS

Implement:

`/play battle royale `

Join a Battle Royale arena.

`/spec battle royale `

Spectate an arena.

`/timer`

Manage the match timer.

Also implement administrative commands to configure:

- Arena creation and deletion.
- Arena world.
- Starting cages.
- Player spawn positions.
- Main Feast.
- Mini-Feasts.
- Chest locations.
- Border center and radius.
- Match settings.

Only authorized administrators may use configuration commands.

---

# 17. ARENA RESET SYSTEM

After each match:

- Declare the winner.
- Play the victory animation.
- End the match.
- Remove temporary entities.
- Restore modified blocks.
- Reset looted chests.
- Reset Feast structures.
- Reset temporary effects.
- Restore the arena to its original playable state.

The arena must be ready for another match without requiring a server restart.

---

# 18. PLUGIN CONFIGURATION

Create configuration files for:

- Arenas.
- Match timers.
- Player limits.
- Cage coordinates.
- Loot tables.
- Feast locations.
- Border behavior.
- Custom weapon damage.
- Cooldowns.
- Durability consumption.
- Special armor.
- Kill animations.
- Victory animations.
- Match messages.
- Administrative permissions.

Use persistent storage for arena settings and Battle Royale player statistics.

---

# 19. DEVELOPMENT AND DELIVERY

Develop the plugin in Java using a compatible Minecraft server API.

Organize the source code into separate systems for arena management, matches, cages, combat, loot, Feast events, borders, weapons, cosmetics, statistics, commands, and arena restoration.

Include:

- Complete Java source code.
- Maven or Gradle project.
- `plugin.yml`.
- Default configuration files.
- Any necessary custom resource-pack assets.
- Compiled `.jar`.
- Installation instructions.
- Command documentation.

Test compilation and all functionality that can be tested in the available environment.

Do not claim unexecuted tests have passed.

---

# FINAL INSTRUCTIONS

**THIS PROJECT IS EXCLUSIVELY A MINECRAFT BATTLE ROYALE MINIGAME PLUGIN.**

DO NOT IMPLEMENT:

- A complete Minecraft server.
- A main lobby.
- Additional lobby worlds.
- Bedwars.
- Skywars.
- Global Coins economy.
- Server-wide cosmetics.
- Server-wide account management.
- Unrelated server systems.
- Minecraft world generation or map construction.
- Dependencies on MoggMC-Cache or Hoplite.

I will provide the Battle Royale map myself.

Your responsibility is to develop the **COMPLETE BATTLE ROYALE GAMEPLAY PLUGIN** that runs inside my existing Minecraft server.

Do not stop after planning.

**WRITE THE CODE, IMPLEMENT THE FEATURES, COMPILE THE JAR, AND DELIVER THE ACTUAL BATTLE ROYALE PLUGIN.**
Kodari AI
KodariNov 10 at 11:14 pm 1

This is a Java server-plugin project. The requested item-free minimap requires a client mod, which this project cannot build. Kodari supports Fabric mods for Minecraft 1.21.11, which could provide that interface alongside a server plugin.

Switch to Fabric 1.21.11

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 401
src/main/java/com/kodari/battleroyale/BattleRoyalePlugin.java
package com.kodari.battleroyale;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.WorldBorder;
import org.bukkit.WorldCreator;
import org.bukkit.block.Block;
import org.bukkit.block.Chest;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.ChunkPopulateEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.UUID;

public final class BattleRoyalePlugin extends JavaPlugin implements Listener {
    private World arena;
    private BukkitTask shrinkTask;
    private BukkitTask eventTask;
    private boolean running;
    private final Random random = new Random();

    @Override
    public void onEnable() {
        saveDefaultConfig();
        Bukkit.getPluginManager().registerEvents(this, this);
        WorldCreator creator = new WorldCreator(getConfig().getString("world.name", "battle_royale"));
        String seed = getConfig().getString("world.seed", "");
        if (seed != null && !seed.isEmpty()) {
            try {
                creator.seed(Long.parseLong(seed));
            } catch (NumberFormatException ex) {
                creator.seed(seed.hashCode());
            }
        }
        arena = creator.createWorld();
        if (arena == null) {
            getLogger().severe("Could not create the battle royale world.");
            getServer().getPluginManager().disablePlugin(this);
        }
    }

    @Override
    public void onDisable() {
        stopMatch(false);
    }

    private Material material(String name) {
        return XMaterial.matchXMaterial(name).map(XMaterial::parseMaterial).orElse(null);
    }

    @EventHandler
    public void onChunkPopulate(ChunkPopulateEvent event) {
        World world = event.getWorld();
        if (!world.getName().equals(getConfig().getString("world.name", "battle_royale"))
                || !getConfig().getBoolean("world.structures-enabled", true)) return;
        Chunk chunk = event.getChunk();
        Random r = new Random(world.getSeed() ^ (chunk.getX() * 341873128712L) ^ (chunk.getZ() * 132897987541L));
        double chance = Math.max(0, Math.min(1, getConfig().getDouble("world.structure-chance", 0.025)));
        if (r.nextDouble() >= chance) return;
        int x = chunk.getX() * 16 + 4;
        int z = chunk.getZ() * 16 + 4;
        int y = world.getHighestBlockYAt(x + 3, z + 3);
        Block ground = world.getBlockAt(x + 3, y, z + 3);
        if (!ground.getType().isSolid() || ground.isLiquid() || y < world.getSeaLevel()
                || y + 9 >= world.getMaxHeight()) return;
        int min = y, max = y;
        for (int dx = 0; dx < 7; dx++) {
            for (int dz = 0; dz < 7; dz++) {
                int h = world.getHighestBlockYAt(x + dx, z + dz);
                min = Math.min(min, h);
                max = Math.max(max, h);
                Block surface = world.getBlockAt(x + dx, h, z + dz);
                if (!surface.getType().isSolid() || surface.isLiquid()) return;
            }
        }
        if (max - min > 3) return;
        if (r.nextBoolean()) buildHouse(world, x, y + 1, z, r);
        else buildTower(world, x, y + 1, z, r);
    }

    private void set(World world, int x, int y, int z, String name) {
        Material type = material(name);
        if (type != null) world.getBlockAt(x, y, z).setType(type, false);
    }

    private void buildHouse(World world, int x, int y, int z, Random r) {
        for (int dx = 0; dx < 7; dx++) {
            for (int dz = 0; dz < 7; dz++) {
                set(world, x + dx, y - 1, z + dz, "COBBLESTONE");
                for (int dy = 0; dy < 4; dy++) {
                    boolean wall = dx == 0 || dx == 6 || dz == 0 || dz == 6;
                    boolean doorway = dz == 0 && dx == 3 && dy < 2;
                    boolean window = dy == 2 && ((dz == 0 || dz == 6) && dx == 3 || (dx == 0 || dx == 6) && dz == 3);
                    set(world, x + dx, y + dy, z + dz, doorway || !wall ? "AIR" : window ? "GLASS_PANE" : "OAK_PLANKS");
                }
                set(world, x + dx, y + 4, z + dz, "OAK_PLANKS");
            }
        }
        placeLootChest(world, x + 2, y, z + 4, r);
    }

    private void buildTower(World world, int x, int y, int z, Random r) {
        for (int dx = 0; dx < 7; dx++) {
            for (int dz = 0; dz < 7; dz++) {
                set(world, x + dx, y - 1, z + dz, "COBBLESTONE");
                for (int dy = 0; dy < 5; dy++) {
                    boolean pillar = (dx == 0 || dx == 6) && (dz == 0 || dz == 6);
                    set(world, x + dx, y + dy, z + dz, pillar ? "OAK_LOG" : "AIR");
                }
                set(world, x + dx, y + 5, z + dz, "OAK_PLANKS");
                if (dx == 0 || dx == 6 || dz == 0 || dz == 6) set(world, x + dx, y + 6, z + dz, "OAK_FENCE");
            }
        }
        // Ladder faces south and is attached to the northern pillar.
        Material ladder = material("LADDER");
        if (ladder != null) {
            for (int dy = 0; dy <= 5; dy++) {
                Block block = world.getBlockAt(x, y + dy, z + 1);
                block.setType(ladder, false);
                org.bukkit.block.data.BlockData data = block.getBlockData();
                if (data instanceof org.bukkit.block.data.Directional) {
                    ((org.bukkit.block.data.Directional) data).setFacing(org.bukkit.block.BlockFace.SOUTH);
                    block.setBlockData(data, false);
                }
            }
        }
        set(world, x, y + 5, z + 1, "LADDER");
        placeLootChest(world, x + 3, y + 6, z + 3, r);
    }

    private void placeLootChest(World world, int x, int y, int z, Random r) {
        set(world, x, y, z, "CHEST");
        if (world.getBlockAt(x, y, z).getState() instanceof Chest) {
            Chest chest = (Chest) world.getBlockAt(x, y, z).getState();
            fillLoot(chest.getBlockInventory(), r);
        }
    }

    private void fillLoot(Inventory inventory, Random r) {
        List<String> entries = getConfig().getStringList("loot.items");
        List<String[]> valid = new ArrayList<>();
        int total = 0;
        for (String entry : entries) {
            String[] parts = entry.split(":");
            if (parts.length != 4) continue;
            try {
                int min = Integer.parseInt(parts[1]);
                int max = Integer.parseInt(parts[2]);
                int weight = Integer.parseInt(parts[3]);
                if (min < 1 || max < min || max > 1024 || weight < 1 || weight > 100000 || total > Integer.MAX_VALUE - weight
                        || !XMaterial.matchXMaterial(parts[0]).isPresent()) continue;
                valid.add(parts);
                total += weight;
            } catch (NumberFormatException ignored) { }
        }
        if (total == 0) return;
        int min = Math.max(0, Math.min(27, getConfig().getInt("loot.min-rolls", 3)));
        int max = Math.max(min, Math.min(27, getConfig().getInt("loot.max-rolls", 7)));
        int rolls = min + r.nextInt(max - min + 1);
        List<Integer> slots = new ArrayList<>();
        for (int i = 0; i < inventory.getSize(); i++) slots.add(i);
        Collections.shuffle(slots, r);
        for (int i = 0; i < rolls && i < slots.size(); i++) {
            int pick = r.nextInt(total);
            for (String[] parts : valid) {
                pick -= Integer.parseInt(parts[3]);
                if (pick >= 0) continue;
                ItemStack item = XMaterial.matchXMaterial(parts[0]).map(XMaterial::parseItem).orElse(null);
                if (item != null && item.getType().isItem()) {
                    int low = Integer.parseInt(parts[1]);
                    int high = Integer.parseInt(parts[2]);
                    item.setAmount(Math.min(item.getMaxStackSize(), low + r.nextInt(high - low + 1)));
                    inventory.setItem(slots.get(i), item);
                }
                break;
            }
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length == 0) return false;
        switch (args[0].toLowerCase(java.util.Locale.ROOT)) {
            case "setspawn":