martin prokic

BEDWARS PLUGIN, HYPIXEL STYLE

IMPORTANT UI RULE

Normal players should almost never need commands.

The normal player experience must be based primarily on vanilla Minecraft GUIs.

Commands should mainly exist for: • Admin setup • Server management • Debugging • Optional shortcuts for experienced players

NORMAL PLAYER GUI SYSTEM

When a player joins the BedWars lobby, they should have a BedWars menu available through a vanilla Minecraft item.

Example:

Compass or configurable vanilla item Name: BedWars

Right click opens:

BEDWARS MENU

Quick Play Solo Doubles 3v3v3v3 4v4v4v4 Team Selection Map Selection Statistics Private Game Leave Queue

No cosmetics menu should exist.

No cosmetic currency should exist.

No cosmetic items should exist.

QUICK PLAY

The player clicks Quick Play.

The plugin automatically finds an available game.

The player does not need to type:

/bw join doubles

The GUI handles it.

MODE SELECTOR

The player can click:

SOLO Doubles 3v3v3v3 4v4v4v4

Each button displays:

Mode Team size Current players Available games

Example:

DOUBLES

2 Players Per Team 8 Teams 12/16 Players

Clicking it joins the queue.

TEAM SELECTOR

The player opens Team Selection.

The GUI displays all teams.

RED Martin Player2 2/2

BLUE Steve Player3 2/2

GREEN Empty 0/2

YELLOW Player4 1/2

The player clicks an available team.

If the team is full, clicking it does nothing and displays:

TEAM FULL

If team selection is disabled:

TEAM SELECTION CLOSED

If the player is in a party, party members should be handled together according to the selected mode.

MAP SELECTOR

Players can select a map through a GUI.

Each map displays:

Map name Mode Availability Current players

Example:

LIGHTHOUSE

Doubles Available

Click to join.

Map selection can be disabled for public matchmaking if desired.

PRIVATE GAME GUI

Private games should also be GUI based for normal players.

The party leader opens:

Private Game

The GUI contains:

Select Mode Select Map Team Settings Game Settings Start Game Close

MODE

Select:

Solo Doubles 3v3v3v3 4v4v4v4

MAP

Select any enabled map.

TEAM SETTINGS

Show all teams.

The party leader can move players between teams using the GUI.

GAME SETTINGS

Allow configurable options such as:

Generator Speed Respawn Time Event Times Bed Protection Resources Game Time

Only settings enabled by the server administrator should be visible.

SHOP GUI

The shop must be completely GUI based.

Players should never need commands to buy normal BedWars items.

The shop uses a vanilla Minecraft inventory.

SHOP CATEGORIES

Blocks Melee Armor Tools Ranged Potions Utility

BLOCKS

Wool

Cost: 4 Iron

Amount: 16 Wool

Clay or End Stone

Cost: 12 Iron

Amount: 16

Wood

Cost: 4 Gold

Amount: 16

Blast-Proof Glass

Cost: 12 Iron

Amount: 4

Obsidian

Cost: 4 Emeralds

Amount: 4

Ladders

Cost: 4 Iron

Amount: 16

MELEE

Stone Sword

Cost: 10 Iron

Iron Sword

Cost: 7 Gold

Diamond Sword

Cost: 4 Emeralds

Stick

Cost: 10 Gold

The stick can represent a Knockback Stick if that mechanic is implemented.

ARMOR

Permanent Leather Armor

Cost:

Default free starter armor.

Permanent Chainmail Armor

Cost: 40 Iron

Permanent Iron Armor

Cost: 12 Gold

Permanent Diamond Armor

Cost: 6 Emeralds

Armor upgrades replace the previous armor tier.

Once purchased, permanent armor remains after death.

TOOLS

Shears

Cost: 20 Iron

Permanent Shears

Cost: 20 Iron

Tier I Pickaxe

Cost: 10 Iron

Tier II Pickaxe

Cost: 10 Gold

Tier III Pickaxe

Cost: 3 Gold

Tier IV Diamond Pickaxe

Cost: 6 Gold

Axe Tier I

Cost: 10 Iron

Axe Tier II

Cost: 10 Gold

Axe Tier III

Cost: 3 Gold

Axe Tier IV Diamond Axe

Cost: 6 Gold

Tool upgrades should be permanent for the player during the game.

When the player dies, the tool tier should remain.

RANGED

Bow

Cost: 12 Gold

Arrows

Cost: 2 Gold

Amount: 8

Power Bow

Cost: 24 Gold

Power upgrade: 4 Emeralds

UTILITY

TNT

Cost: 4 Gold

Fireball

Cost: 40 Iron

Water Bucket

Cost: 3 Gold

Ender Pearl

Cost: 4 Emeralds

Bridge Egg

Cost: 2 Emeralds

If Bridge Egg is implemented, it should use vanilla projectile/entity mechanics.

Bed Bug

Cost: 40 Iron

Dream Defender

Cost: 120 Iron

Sponge

Cost: 3 Gold

Amount: 4

Milk

Cost: 50 Iron

Invisibility Potion

Cost: 2 Emeralds

Speed Potion

Cost: 1 Emerald

Jump Boost Potion

Cost: 1 Emerald

Golden Apple

Cost: 3 Gold

BREAD OR FOOD

If food is included:

Golden Apple 3 Gold

Steak 4 Gold

All prices must be configurable.

The exact default prices must exist in shops.yml so administrators can change them.

TEAM UPGRADES

Team upgrades are also GUI based.

The player clicks the Team Upgrades shop.

GUI categories:

Weapons Armor Forge Tools Traps Team Utility

SHARPNESS

Level I: 8 Diamonds

Protection I: 2 Diamonds

Protection II: 4 Diamonds

Protection III: 8 Diamonds

Protection IV: 16 Diamonds

HASTE

Haste I: 2 Diamonds

Haste II: 4 Diamonds

FORGE

Forge I: 2 Diamonds

Forge II: 4 Diamonds

Forge III: 6 Diamonds

Forge IV: 8 Diamonds

HEAL POOL

Cost: 1 Diamond

TRAPS

Trap 1: 1 Diamond

Trap 2: 2 Diamonds

Trap 3: 3 Diamonds

Trap 4: 4 Diamonds

The exact trap prices should be configurable.

TRAP QUEUE

A team can purchase traps.

The first purchased trap goes into the first available trap slot.

The GUI should show:

TRAP SLOT 1 Active

TRAP SLOT 2 Empty

TRAP SLOT 3 Empty

The team can purchase another trap when a slot is available.

GENERATOR UPGRADE GUI

The team can upgrade its forge through the Team Upgrades GUI.

The GUI displays:

Current Level Next Level Price Production Speed

Example:

IRON FORGE I

Current: 1x resource

Upgrade: 2 Diamonds

Next:

Faster Iron and Gold

ADMIN MAP SETUP

Admins should have commands because map creation needs precise setup.

Normal players should not have access to these commands.

ADMIN SETUP WAND

The plugin should provide an optional vanilla setup item.

Command:

/bw admin wand

The item can be a stick or another configurable vanilla item.

The setup wand can be used to select positions.

ADMIN SETUP MENU

Command:

/bw setup <map>

This opens an admin GUI.

The GUI contains:

Map Information Team Setup Generator Setup Shop Setup Lobby Setup Spectator Setup World Settings Protection Validation Save Enable Map

MAP INFORMATION

Map Name Map ID Supported Modes World Name Status

TEAM SETUP

The admin selects:

Red Blue Green Yellow Aqua White Pink Gray

Then configures:

Team Spawn Bed Iron Generator Gold Generator Shop Upgrade Shop

GENERATOR SETUP

The admin can select:

Iron Gold Diamond Emerald

Then set the location.

Command shortcuts should also exist.

MAP SETUP COMMANDS

/bw setup <map>

/bw setup team <team>

/bw setup spawn <team>

/bw setup bed <team>

/bw setup iron

/bw setup gold

/bw setup diamond

/bw setup emerald

/bw setup shop

/bw setup upgradeshop

/bw setup spectator

/bw setup lobby

/bw setup pos1

/bw setup pos2

/bw setup save

/bw setup validate

/bw setup finish

ARENA COMMANDS

/bw arena create <name>

/bw arena delete <name>

/bw arena list

/bw arena info <name>

/bw arena enable <name>

/bw arena disable <name>

/bw arena reset <name>

/bw arena start <name>

/bw arena stop <name>

/bw arena restart <name>

MAP COMMANDS

/bw map create <name>

/bw map delete <name>

/bw map list

/bw map info <name>

/bw map clone <source> <target>

/bw map enable <name>

/bw map disable <name>

/bw map reset <name>

/bw map validate <name>

GENERATOR COMMANDS

/bw generator list

/bw generator info

/bw generator create <type>

/bw generator delete

/bw generator set <type>

/bw generator reset

ADMIN PLAYER COMMANDS

/bw admin kick <player>

/bw admin teleport <player>

/bw admin spectate <player>

/bw admin revive <player>

/bw admin eliminate <player>

/bw admin team <player> <team>

/bw admin forcejoin <player> <arena>

GAME ADMIN COMMANDS

/bw start

/bw forcestart

/bw stop

/bw end

/bw reset

/bw reload

/bw status

/bw debug

/bw version

CONFIGURATION COMMANDS

/bw reload

/bw config reload

/bw config save

/bw config validate

SHOP CONFIGURATION

Every shop item must be stored in a configuration file.

Example:

shops.yml

blocks: wool: material: WHITE_WOOL amount: 16 currency: IRON price: 4

end_stone: material: END_STONE amount: 16 currency: IRON price: 12

wood: material: OAK_PLANKS amount: 16 currency: GOLD price: 4

melee: stone_sword: material: STONE_SWORD currency: IRON price: 10

iron_sword: material: IRON_SWORD currency: GOLD price: 7

diamond_sword: material: DIAMOND_SWORD currency: EMERALD price: 4

armor: chainmail: currency: IRON price: 40

iron: currency: GOLD price: 12

diamond: currency: EMERALD price: 6

utility: tnt: material: TNT currency: GOLD price: 4

fireball: material: FIRE_CHARGE currency: IRON price: 40

ender_pearl: material: ENDER_PEARL currency: EMERALD price: 4

Every item should have:

Display name Material Amount Currency Price Lore Category Purchase requirements Upgrade requirements

GUI SHOP BEHAVIOR

When a player opens the shop:

Items they can afford should be clearly selectable.

Items they cannot afford should remain visible but display:

COST: 4 Iron

The GUI should update automatically when the player's resources change.

Clicking an item purchases it.

Shift clicking should not bypass prices.

Double clicking should not duplicate items.

The server must validate every purchase.

ITEM DUPLICATION PROTECTION

The plugin must validate:

Currency amount Inventory space Item amount Purchase cooldown Player game state Shop state

The client must never be trusted to determine whether a purchase is valid.

NORMAL PLAYER COMMANDS

Players should only need a small number of commands.

Main:

/bw /bw leave /bw stats /bw help

Party:

/party /p

Team chat:

/bw tc

Lobby:

/bw lobby

Everything else should preferably be handled through GUIs.

COMMANDS AS GUI SHORTCUTS

Commands such as:

/bw stats

should simply open the statistics GUI.

For example:

/bw team

opens the team GUI.

/bw shop

opens the shop when the player is inside a valid game.

The GUI remains the primary interface.

ADMIN GUI

Admins should also have a central administration GUI.

Command:

/bw admin

GUI:

Arenas Maps Generators Shops Games Players Statistics Configuration Debug Reload

ARENA ADMIN GUI

Select an arena.

Then:

Start Stop Reset Enable Disable Info Players Teams Generators Validation

MAP ADMIN GUI

Select a map.

Then:

Create Clone Delete Enable Disable Setup Validate Reset

SHOP ADMIN GUI

The administrator can inspect shop configuration.

Categories:

Blocks Melee Armor Tools Ranged Potions Utility Upgrades

The GUI should display each item's:

Material Price Currency Amount Status

The actual configuration files remain the source of truth.

NO COSMETICS

Do not implement:

Coins for cosmetics Particles Death effects Kill effects Victory dances Capes Hats Pets Custom trails Emotes Skins Custom animations Cosmetic menus

The plugin should focus entirely on BedWars gameplay.

VANILLA MINECRAFT REQUIREMENT

All gameplay items must be normal Minecraft items.

Examples:

IRON_INGOT GOLD_INGOT DIAMOND EMERALD WHITE_WOOL STONE_SWORD IRON_SWORD DIAMOND_SWORD TNT FIRE_CHARGE BOW ARROW ENDER_PEARL WATER_BUCKET GOLDEN_APPLE POTION

Do not require custom resource packs.

Do not create custom textures.

Do not require OptiFine.

Do not require client-side mods.

The server must provide the complete gameplay experience using Minecraft's existing systems.

DATA STORAGE

Use UUIDs for player identification.

Store:

UUID Current username Wins Losses Kills Deaths Final kills Beds destroyed Games played Win streak

Map data should contain:

Team locations Beds Generators Shops Upgrade shops Spectator spawn Lobby World Protected regions Supported modes

ARENA VALIDATION

Before an arena can start, validate:

World exists.

Every required team exists.

Every team has a spawn.

Every team has a bed.

Every team has an iron generator.

Every team has a gold generator.

Every team has a shop.

Every team has an upgrade shop.

Required diamond generators exist.

Required emerald generators exist.

Spectator location exists.

Lobby location exists.

If something is missing:

ARENA INVALID

Missing:

Blue Bed Green Spawn Emerald Generator

The admin can fix the problem through:

/bw setup <map>

or the Admin Setup GUI.

FINAL DESIGN

Normal player:

Join lobby.

Open vanilla BedWars item.

Select game mode through GUI.

Select team through GUI.

See real usernames.

Join game.

Buy items through GUI.

Buy upgrades through GUI.

Play BedWars.

Become spectator after final death.

See game results.

Return to lobby.

Admin:

Create map.

Open Admin Setup GUI.

Set all locations.

Configure teams.

Configure generators.

Configure shops.

Validate map.

Enable map.

Start games.

Monitor games.

Reset arenas.

Reload configuration.

Commands should exist mainly for administrators and setup.

GUIs should be the primary interface for normal players.

Every shop item, price, amount, currency and upgrade should be configurable.

The entire gameplay system should use vanilla Minecraft items, blocks, entities, inventories, effects, sounds, particles, scoreboards, teams, data components and server-side mechanics.

No cosmetics.

No fake usernames.

No random player names.

No custom resource pack.

No BedWars1058 dependency.

No Citizens dependency.

No external gameplay dependency.

Kodari AI
KodariSep 30 at 7:30 am 1
BedWarsCore
A comprehensive Hypixel-style BedWars plugin with GUI-driven gameplay for normal players. Features a vanilla Minecraft item menu system for game mode selection, team selection, map selection, and private games. Includes a fully GUI-based shop with configurable items, prices, and currencies, plus team upgrade system with traps and forge upgrades. Admin tools include setup wands, map creation/validation, arena management, and configuration commands. All data stored via UUIDs with complete statistics tracking. No cosmetics, no external dependencies, pure vanilla Minecraft experience.
  1. Create the Paper project and configurable vanilla-item resources.

  2. Add the lobby menu, mode/map selection, and persistent matchmaking queues.

  3. Add player stats and admin map setup/validation commands with a setup GUI.

Created the initial GUI-first BedWars project: lobby menu item, mode and map menus, in-memory matchmaking queues, stats display, admin map setup commands/GUI, and configurable vanilla-item shop and upgrade prices.

This is a foundation, not the complete BedWars system. Live arena matches, team assignment, shop and upgrade purchases, private games/parties, and gameplay-driven stat updates are not implemented yet. The project has not been build-verified.

martin prokic

Wich version

Kodari AI
KodariSep 30 at 11:52 am 1

This project targets Paper 1.21.4 and Java 21. Its plugin version is 1.0.0.

martin prokic

Can you make it 26.2

Kodari AI
KodariSep 30 at 11:52 am 1

[Generation stopped]

martin prokic

Dose it work on 26.2 the 1.21.4 version on 26.2

Kodari AI
KodariSep 30 at 11:53 am 1

It might work on a Paper 26.2 server, but the 1.21.4 target doesn’t guarantee it. Newer Paper versions often keep older plugins working, but removed or changed APIs—and any plugin dependencies—can prevent it from loading. It hasn’t been tested on 26.2.

martin prokic

Then change the version

Kodari AI
KodariSep 30 at 11:53 am 1

Updating the Paper API target, plugin api-version, and Java toolchain for 26.2.

Updated the project to target Paper 26.2: the Paper API dependency and plugin api-version are now 26.2, and the Java toolchain is set to 25.

martin prokic

Download pls

Kodari AI
KodariSep 30 at 11:54 am 1

There’s no .jar in the project to download—the changes updated the source files, but didn’t produce a build artifact. Build it with gradle build; the plugin jar should appear in build/libs/.

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

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;

public final class BedWarsPlugin extends JavaPlugin implements Listener {
    private static final List<String> TEAM_NAMES = Arrays.asList("Red", "Blue", "Green", "Yellow", "Aqua", "White", "Pink", "Gray");

    private final QueueManager queues = new QueueManager();
    private File mapsFile;
    private File statsFile;
    private YamlConfiguration maps;
    private YamlConfiguration stats;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("shops.yml", false);
        saveResource("maps.yml", false);
        saveResource("stats.yml", false);
        mapsFile = new File(getDataFolder(), "maps.yml");
        statsFile = new File(getDataFolder(), "stats.yml");
        reloadData();
        Bukkit.getPluginManager().registerEvents(this, this);
        if (getCommand("bw") != null) {
            getCommand("bw").setExecutor(this);
        }
    }

    private void reloadData() {
        maps = YamlConfiguration.loadConfiguration(mapsFile);
        stats = YamlConfiguration.loadConfiguration(statsFile);
    }

    @Override
    public void onDisable() {
        saveMaps();
        saveStats();
    }

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        if (!getConfig().getBoolean("lobby-item.enabled", true)) {
            return;
        }
        ItemStack item = item(getConfig().getString("lobby-item.material", "COMPASS"), getConfig().getString("lobby-item.name", "&bBedWars &7(Right-click)"), List.of("&7Open game modes and settings"));
        if (item == null) {
            return;
        }
        int slot = Math.max(0, Math.min(8, getConfig().getInt("lobby-item.slot", 0)));
        player.getInventory().setItem(slot, item);
    }

    @EventHandler
    public void onLobbyItem(PlayerInteractEvent event) {
        Action action = event.getAction();
        if (action != Action.RIGHT_CLICK_AIR && action != Action.RIGHT_CLICK_BLOCK) {
            return;
        }
        ItemStack held = event.getItem();
        if (held == null || !isLobbyItem(held)) {
            return;
        }
        event.setCancelled(true);
        openMain(event.getPlayer());
    }

    @EventHandler
    public void onMenuClick(InventoryClickEvent event) {
        if (!(event.getView().getTopInventory().getHolder() instanceof MenuHolder holder)) {
            return;
        }
        event.setCancelled(true);
        if (!(event.getWhoClicked() instanceof Player player) || event.getRawSlot() < 0 || event.getRawSlot() >= event.getView().getTopInventory().getSize()) {
            return;
        }
        int slot = event.getRawSlot();
        switch (holder.menu()) {
            case MAIN -> handleMainClick(player, slot);
            case MODES -> handleModeClick(player, slot, holder.context());
            case MAPS -> handleMapClick(player, slot);
            case TEAMS -> player.sendMessage(color("&eTeam selection is available after a game is assigned."));
            case STATS -> player.closeInventory();
            case ADMIN -> handleAdminClick(player, slot);
            case SETUP -> player.sendMessage(color("&7Use /bw setup set <map> <location-key> to configure this map."));
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length == 0) {
            if (sender instanceof Player player) {
                openMain(player);
            } else {
                sender.sendMessage("Use /bw setup from the console only for commands that do not require a player location.");
            }
            return true;
        }
        String subcommand = args[0].toLowerCase(Locale.ROOT);
        if (sender instanceof Player player && List.of("leave", "stats", "team", "map", "admin").contains(subcommand)) {
            switch (subcommand) {
                case "leave" -> leaveQueue(player);
                case "stats" -> openStats(player);
                case "team" -> openTeams(player);
                case "map" -> openMaps(player);
                case "admin" -> {
                    if (!player.hasPermission("bedwars.admin")) {
                        player.sendMessage(message("&cYou do not have permission."));
                    } else {
                        openAdmin(player);
                    }
                }
            }
            return true;
        }
        if (subcommand.equals("reload")) {
            if (!sender.hasPermission("bedwars.admin")) {
                sender.sendMessage(message("&cYou do not have permission."));
                return true;
            }
            reloadConfig();
            reloadData();
            sender.sendMessage(message("&aConfiguration reloaded."));
            return true;
        }
        if (subcommand.equals("setup")) {
            return handleSetup(sender, args);
        }
        sender.sendMessage(message("&7Use &f/bw&7 to open the menu. Admins: &f/bw setup help"));
        return true;
    }

    private boolean handleSetup(CommandSender sender, String[] args) {
        if (!sender.hasPermission("bedwars.admin")) {
            sender.sendMessage(message("&cYou do not have permission."));
            return true;
        }
        if (args.length == 2 && sender instanceof Player player) {
            openSetup(player, args[1]);
            return true;
        }
        if (args.length == 2 && args[1].equalsIgnoreCase("help")) {
            sender.sendMessage(color("&e/bw setup create <map> &7- create a map"));
            sender.sendMessage(color("&e/bw setup set <map> <key> &7- save your location"));
            sender.sendMessage(color("&e/bw setup validate <map> &7- list missing locations"));
            sender.sendMessage(color("&e/bw setup enable|disable|delete|list <map>"));
            return true;
        }
        if (args.length >= 2 && args[1].equalsIgnoreCase("list")) {
            ConfigurationSection section = maps.getConfigurationSection("maps");
            sender.sendMessage(color("&eMaps: &f" + (section == null || section.getKeys(false).isEmpty() ? "none" : String.join(", ", section.getKeys(false)))));
            return true;
        }
        if (args.length == 3 && args[1].equalsIgnoreCase("create")) {
            String id = args[2].toLowerCase(Locale.ROOT);
            if (!id.matches("[a-z0-9_-]+") || maps.contains("maps." + id)) {
                sender.sendMessage(message("&cInvalid or existing map ID."));
                return true;
            }
            maps.set("maps." + id + ".enabled", false);
            maps.set("maps." + id + ".world", sender instanceof Player player ? player.getWorld().getName() : "");
            maps.set("maps." + id + ".supported-modes", Arrays.stream(GameMode.values()).map(mode -> mode.name()).toList());
            saveMaps();
            sender.sendMessage(message("&aCreated map &f" + id + "&a. Configure locations with /bw setup set."));
            return true;
        }
        if (args.length == 4 && args[1].equalsIgnoreCase("set")) {
            if (!(sender instanceof Player player)) {
                sender.sendMessage("This setup command requires a player.");
                return true;
            }