hungtraan0

make me a minecràt battle royale plugin like Hoplite

Kodari AI
KodariJun 11 at 10:02 am 18

I’ll create a battle royale plugin inspired by Hoplite with shrinking borders, loot systems, and game state management.

HopliteBR
A Minecraft battle royale plugin inspired by Hoplite. Features include shrinking world borders that force player confrontation, randomized loot chest spawning, pre-game lobby with countdown system, spectator mode for eliminated players, configurable game phases, and statistics tracking. Supports multiple arenas with customizable settings including border shrink speed, game duration, and minimum players. Includes admin commands for game control and arena management.

All files created! HopliteBR is ready with:

✓ Full game state system (WAITING → STARTING → ACTIVE → ENDING)
✓ Shrinking world border with configurable grace period
✓ Random loot chest spawning with weapon/armor/food drops
✓ Player scatter system around arena center
✓ Spectator mode for eliminated players
✓ Countdown system with player requirement checks
✓ Statistics tracking (kills, deaths, wins)
✓ Admin commands for setup and control
✓ Event protection during lobby/countdown phases

Quick Start:

  1. /br setlobby - Set waiting lobby location

  2. /br setarena - Set arena center (border spawns here)

  3. /br join - Players join the game

  4. Game auto-starts when minimum players join, or /br forcestart

Border shrinks progressively after grace period, loot chests spawn at game start, and eliminated players become spectators watching the action!

hungtraan0

make the plugin compatible with placeholderapi and make a scoreboard and make it look like this

1 image attached
Kodari AI
KodariJun 11 at 10:16 am 45

I’ll add PlaceholderAPI integration and create a scoreboard matching that Hoplite style.

Now I need to update the ConfigManager to include the new config options, and update HopliteBR to register the expansion and scoreboard manager.

Perfect! HopliteBR now has full PlaceholderAPI integration and a stylish scoreboard matching the Hoplite design.

✓ PlaceholderAPI Placeholders:

  • %hoplitebr_state% - Game state (WAITING/STARTING/ACTIVE/ENDING)

  • %hoplitebr_players% - Total players in game

  • %hoplitebr_max_players% - Max players allowed

  • %hoplitebr_alive% - Alive players count

  • %hoplitebr_countdown% - Countdown seconds

  • %hoplitebr_gametime% - Formatted game time (MM:SS)

  • %hoplitebr_gracetime% - Grace period remaining

  • %hoplitebr_kills% - Player kills

  • %hoplitebr_deaths% - Player deaths

  • %hoplitebr_wins% - Player wins

  • %hoplitebr_border% - Border radius

  • %hoplitebr_is_playing% - true/false

  • %hoplitebr_is_spectator% - true/false

✓ Scoreboard Features:

  • Date & time display (MM/DD/YY HH:MM)

  • PVP status with countdown timer

  • Color-coded status (green=waiting, yellow=grace, red=active)

  • Players count (current/max)

  • Personal stats (⚔ kills, ☠ deaths)

  • Border size with color warnings (green→red as it shrinks)

  • Server IP at bottom

  • Right-side aesthetic colored numbers

  • Auto-updates every second (configurable)

The scoreboard creates individual boards per player, updates dynamically based on game state, and cleans up properly on player quit/server shutdown!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
27 1,712
src/main/java/com/hoplitebr/HopliteBR.java
package com.hoplitebr;

import com.hoplitebr.command.BRCommand;
import com.hoplitebr.expansion.BRExpansion;
import com.hoplitebr.listener.*;
import com.hoplitebr.manager.*;
import com.hoplitebr.util.MessageUtil;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class HopliteBR extends JavaPlugin {
    
    private ConfigManager configManager;
    private GameManager gameManager;
    private ArenaManager arenaManager;
    private PlayerManager playerManager;
    private BorderManager borderManager;
    private LootManager lootManager;
    private SpectatorManager spectatorManager;
    private ScoreboardManager scoreboardManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        // Initialize managers
        this.configManager = new ConfigManager(this);
        this.arenaManager = new ArenaManager(this);
        this.playerManager = new PlayerManager(this);
        this.borderManager = new BorderManager(this);
        this.lootManager = new LootManager(this);
        this.spectatorManager = new SpectatorManager(this);
        this.gameManager = new GameManager(this);
        this.scoreboardManager = new ScoreboardManager(this);
        
        // Register PlaceholderAPI expansion
        if (getServer().getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new BRExpansion(this).register();
            MessageUtil.log("&aPlaceholderAPI hook registered!");
        }
        
        // Register commands
        getCommand("br").setExecutor(new BRCommand(this));
        
        // Register listeners
        getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerQuitListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerDeathListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerMoveListener(this), this);
        getServer().getPluginManager().registerEvents(new BlockBreakListener(this), this);
        getServer().getPluginManager().registerEvents(new BlockPlaceListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerDamageListener(this), this);
        
        MessageUtil.log("&aHopliteBR has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (gameManager != null && gameManager.isGameActive()) {
            gameManager.endGame(null);
        }
        if (scoreboardManager != null) {
            scoreboardManager.shutdown();
        }
        MessageUtil.log("&cHopliteBR has been disabled!");
    }
}