๐
1 file
5,020 chars
๐
pasted-code-1774042123155.txt
txt
243 lines
โถ
pasted-code-1774042123155.txt
txt
243 lines
You are a senior Minecraft plugin developer.
Your task is to create a COMPLETE, production-ready, fully functional Battle Royale plugin using Java for Paper 1.21+.
Plugin Name: QuillsBattleRoyale
====================
STRICT REQUIREMENTS
====================
- The plugin MUST compile with ZERO errors
- DO NOT skip ANY feature
- DO NOT simplify logic
- DO NOT merge everything into one class
- Use clean OOP design
- Follow Paper API best practices
- Code must be readable, maintainable, and well-commented
====================
PROJECT STRUCTURE
====================
Create a multi-class architecture:
Main:
- QuillsBattleRoyale (main class)
Managers:
- GameManager
- TeamManager
- PlayerManager
- CombatManager
- ConfigManager
Enums:
- GameState (WAITING, STARTING, DROP, PVP_DISABLED, ACTIVE, ENDING, PAUSED)
Commands (separate classes):
- GameCommand (/game start, pause, resume, end)
- TeamCommand (/teamcreate, invite, accept, leave)
- RecipeCommand (/recipe)
- LocationCommand (/locationset, /winner1set, /winner2set, /winner3set)
Listeners:
- PlayerListener
- CombatListener
- GameListener
====================
CORE GAME FLOW
====================
STATE: WAITING
- Players idle at world spawn
/game start:
- Require minimum players (configurable)
- Change state โ STARTING
- 10-second countdown using Titles (10 โ 0)
- Play sounds each second
After countdown:
- Title: "Battle Royale Started"
- Broadcast configurable message
- Teleport ALL players to a random spread around a set center location:
- Center set via /locationset here
- Spread radius configurable (e.g. 500 blocks)
- Use safe random locations (no lava, air drops, etc.)
STATE โ DROP
DROP PHASE:
- Give ALL players Feather Falling (high level)
- Detect when EACH player touches ground:
- Remove effect ONLY for that player
- When ALL players have landed OR after timeout โ continue
After 30 seconds:
- STATE โ PVP_DISABLED
- Show Title:
Title: "PVP OFF"
Subtitle: "PVP disabled for %time%"
After configured time (default 15 minutes):
- STATE โ ACTIVE
- Enable PVP
- Broadcast "PVP Enabled"
====================
TEAM SYSTEM
====================
Commands:
- /teamcreate
- /teaminvite
- /teamaccept
- /teamleave
Rules:
- Max team size: 3 (configurable)
- Use Scoreboard Teams:
- Green glowing teammates
- Friendly fire: DISABLED
Edge cases:
- Owner leaves โ transfer ownership
- Player disconnects โ handle properly
- Prevent joining multiple teams
====================
COMBAT SYSTEM
====================
- Track kills per player
- On death:
- Update kill counts
- Mark player as eliminated
- Switch to spectator mode
Custom Weapon:
- Defined in config.yml
- Custom crafting recipe
- Add special effect (e.g. extra damage or potion effect)
Command:
- /recipe โ show crafting recipe (INVENTORY GUI preferred)
====================
WIN CONDITION
====================
- Continuously check alive teams
- When ONE team remains:
STATE โ ENDING
- Calculate kills per player
- Sort team members by kills
Display:
- Title: Team Name
- Subtitle: "Total Kills: X"
Teleport:
- #1 kills โ /winner1set
- #2 kills โ /winner2set
- #3 kills โ /winner3set
====================
PAUSE SYSTEM
====================
/game pause:
- STATE โ PAUSED
- Freeze EVERYTHING:
- Cancel movement
- Cancel damage
- Cancel interactions
- Only OP players can move
/game resume:
- Restore previous state
====================
END SYSTEM
====================
/game end:
- Force stop game
- Reset ALL:
- Teams
- Players
- Scoreboards
- Effects
- Game state โ WAITING
====================
CONFIG (config.yml)
====================
Must include:
- Messages (fully customizable)
- Timers:
- Countdown
- Drop phase
- PVP delay
- Team size
- Spread radius
- Minimum players
- Custom weapon settings
- Locations (auto-saved):
- center
- winner1
- winner2
- winner3
====================
DATA HANDLING
====================
- Use HashMaps for:
- Player kills
- Teams
- Alive players
- Game state tracking
- Handle:
- Player quit mid-game
- Rejoin logic (optional but preferred)
====================
PERFORMANCE
====================
- Avoid heavy loops every tick
- Use BukkitRunnable where needed
- Optimize event usage
====================
OUTPUT FORMAT (IMPORTANT)
====================
1. Show FULL project structure (folder + files)
2. Provide EACH file separately:
- Main class
- All managers
- All commands
- All listeners
3. Provide:
- plugin.yml
- config.yml
4. Include build system (Maven preferred)
5. Include compile + install instructions
====================
FINAL RULE
====================
If ANY feature is missing, incomplete, or simplified โ the answer is WRONG.
You must deliver a COMPLETE working plugin.
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code