Act as an expert Minecraft plugin developer (Paper/Spigot 1.21.11, Java 21). Create a fully functional DeathRun minigame plugin inspired by HiveMC with a modular configuration system. ================================================== CORE SYSTEM ================================================== - Game states: WAITING, STARTING, RUNNING, ENDING - /deathrun join, leave, start (admin) - Random Death selection - Lobby countdown - Teleport system ================================================== ARENA SYSTEM ================================================== Support predefined arenas with: - lobby spawn - death spawn - runner spawn - finish location - checkpoints Arenas should be stored in config.yml or arenas.yml. ================================================== CONFIG FILES (IMPORTANT) ================================================== Use multiple YAML files: 1. config.yml - General settings - countdown time - min players - arena selection 2. arenas.yml - Arena definitions: - world - lobby spawn - death spawn - runner spawn - finish location - checkpoints 3. traps.yml - Trap definitions: - name - trigger type (LEVER, BUTTON, PRESSURE_PLATE) - location - world - effect type (LAVA, TNT, PISTON, etc.) - cooldown 4. rewards.yml - Rewards for winners: - commands for runners - commands for death - Commands executed by console when game ends ================================================== TRAP SYSTEM ================================================== - Death can activate traps via: - interacting with triggers - or /trap <name> - Only Death can activate traps - Each trap has cooldown - Trigger detection via PlayerInteractEvent ================================================== CHECKPOINT SYSTEM ================================================== - Checkpoints defined in arenas.yml - When runners pass a checkpoint: - save their checkpoint - On death: - respawn at last checkpoint ================================================== WIN CONDITIONS ================================================== - Runners win if at least one reaches finish - Death wins if all runners die - When game ends: - execute rewards from rewards.yml - teleport players back to lobby ================================================== COMMANDS ================================================== /deathrun join /deathrun leave /deathrun start /deathrun setlobby /deathrun setdeathspawn /deathrun setrunnerspawn /deathrun setfinish /deathrun setcheckpoint /deathrun settrap <name> ================================================== CODE STRUCTURE ================================================== Generate modular architecture: - Main class - GameManager - ArenaManager (loads arenas.yml) - TrapManager (loads traps.yml) - RewardManager (loads rewards.yml) - CheckpointManager - Command classes - Listener classes ================================================== EVENTS ================================================== Handle: - PlayerJoinEvent - PlayerQuitEvent - PlayerDeathEvent - PlayerInteractEvent - PlayerMoveEvent ================================================== REQUIREMENTS ================================================== - Paper API 1.21.11 - Java 21 - Fully working code - Clean OOP structure - No pseudocode - All classes included - All YAML files included - Proper file loading for multiple configs ================================================== OUTPUT ================================================== Generate: - Java source code - plugin.yml - config.yml - arenas.yml - traps.yml - rewards.yml - Full working implementation ================================================== RELOAD SYSTEM ================================================== Implement a reload command: /deathrun reload Features: - Reload all configuration files without restarting the server - Reload the following files: - config.yml - arenas.yml - traps.yml - rewards.yml Requirements: - Reload managers (ArenaManager, TrapManager, RewardManager) - Clear cached data and reload from files - Handle errors safely (try/catch) - Send confirmation message to the command sender Implementation details: - Each manager must have a reload() method - The main plugin command should call all reload methods - Ensure no memory leaks or duplicated data after reload ================================================== ADMIN COMMANDS ================================================== Add an admin command: /deathrunadmin forcestart Features: - Force start the game immediately - Ignore minimum player requirements - Skip countdown and start instantly - Randomly assign Death - Teleport all players into the arena - Change state directly to RUNNING Permissions: - Only players with admin permission can use it (e.g. deathrun.admin) Safety: - Prevent starting if a game is already running - Send error message if game is not in WAITING state