📄
pasted-code-1783625173488.txt
txt
883 lines
▶
ZDuels – Master Prompt for Kodari AI
Goal: Create a production-ready Minecraft Paper 1.21+ plugin called ZDuels. The plugin should be lightweight, modular, configurable, asynchronous where possible, and optimized for servers with hundreds of players. Every feature must be configurable through YAML configuration files and reloadable without restarting whenever possible.
General Requirements
Develop a plugin named ZDuels for PaperMC 1.21+.
The plugin should be similar to normal duel plugins but with a completely unique dynamic arena generation system.
Everything possible must be configurable using YAML configuration files.
The code should follow clean OOP principles, be easy to maintain, heavily documented, and separated into managers/services.
Suggested package structure:
me.znetwork.zduels
│
├── commands
├── config
├── duel
├── arena
├── world
├── kits
├── party
├── queue
├── INVENTORY INVENTORY GUI
├── listeners
├── placeholder
├── database
├── util
└── api
Support:
Paper 1.21+
Java 21
Folia compatibility if possible
PlaceholderAPI support
Vault support
MiniMessage support
Adventure API
WorldEdit support (optional)
FAWE support (optional)
Plugin Philosophy
The plugin should require almost no setup.
Instead of forcing server owners to manually build hundreds of arenas, the plugin automatically creates them.
Players simply duel.
The plugin manages everything else.
Startup Wizard
When the plugin runs for the first time:
/zduels startup
Starts an interactive setup.
Example:
Welcome to ZDuels!
How many PvP worlds should be generated?
> 5
What arena generation method?
1. Flat Box
2. Schematic
> 2
Select schematic:
arenas/default.schem
Maximum arenas per world?
>20
Arena size?
>75
Generating worlds...
âś” pvp-1
âś” pvp-2
âś” pvp-3
âś” pvp-4
âś” pvp-5
Setup complete.
After setup all configuration files should be generated.
Configuration Files
Generate these:
config.yml
messages.yml
arenas.yml
kits.yml
parties.yml
worlds.yml
INVENTORY INVENTORY GUI.yml
database.yml
queue.yml
scoreboard.yml
effects.yml
Everything should be editable.
Arena System (Main Feature)
This is the most important system.
Instead of static arenas, arenas are generated dynamically.
World Generation
The plugin generates:
pvp-1
pvp-2
pvp-3
...
Amount chosen during startup.
Arena Allocation
When a duel starts:
Search World 1
Is there a free arena?
YES
→ Use it
NO
↓
Does World 1 contain fewer than configured maximum arenas?
YES
↓
Generate another arena
NO
↓
Move to World 2
Repeat.
Example:
World 1
Arena 1 (occupied)
Arena 2 (occupied)
...
Arena 20 (occupied)
↓
World 2
Arena 1
Generate
Done.
If ALL worlds are full:
Player enters queue until arena becomes available.
Arena Generation Methods
Two options.
1. Flat Arena
Automatically generates
bedrock floor
configurable block palette
world border
spawn points
spectator platform
barriers
Everything configurable.
2. Schematic
Uses WorldEdit/FAWE.
Copies
plugins/ZDuels/schematics/default.schem
Places it automatically.
Then searches for markers.
Example markers:
SPAWN_1
SPAWN_2
CENTER
SPECTATOR
Automatically saves coordinates.
Arena Recycling
After duel:
Arena resets.
If schematic:
Repaste schematic.
If flat:
Clear entities
Replace blocks
Reset weather
Reset time
Reset borders
Spawn Configuration
Every arena stores
spawn1
spawn2
spawn3
spawn4
...
supports unlimited teams
Admin can modify later.
Duel Types
Support:
1v1
2v2
3v3
4v4
FFA
Party vs Party
Custom Teams
Unlimited teams if configured.
Duel Commands
/duel
/duel accept
/duel deny
/duel spectate
/duel leave
/duel stats
/duel history
/duel top
/duel rematch
/duel random
/duel queue
Party System
Commands:
/party create
/party invite
/party kick
/party leave
/party disband
/party chat
/party duel
/party list
/party promote
Features:
Party leader
Party chat
Friendly fire toggle
Party vs Party
Offline invites (optional)
Invite expiration
Queue System
Players can join queues.
Example:
Ranked
Unranked
Boxing
Crystal
Sword
Netherite
Custom Kits
Automatic matchmaking.
Kit Editor
Players create kits using INVENTORY INVENTORY GUI.
/kit create
INVENTORY INVENTORY GUI like Hypixel/Duels.
Features:
Armor
Inventory
Offhand
Effects
Attributes
Food
XP
Health
Hunger
Saturation
Respawn items
Preview
Clone
Delete
Rename
Publish
Private/Public
Category
Description
Icon
Difficulty
Version
Tags
If duel uses custom kit:
Opponent receives EXACT copy.
No unfair advantage.
Public Kit Browser
/kits
INVENTORY INVENTORY GUI showing
Popular
Newest
Most Played
Highest Rated
Friends
Categories
Search
Favorites
Public only.
World Rules Editor
Every custom kit can define world settings.
INVENTORY INVENTORY GUI.
Options:
Weather
Time
Keep Inventory
Mob Spawning
Natural Regeneration
Fire Spread
Explosion Damage
Block Breaking
Block Placing
Fall Damage
Void Damage
Fire Damage
Drowning
PvP
Hunger
Locator Bar
Coordinates
Elytra
Totems
Pearls
Shields
Golden Apples
Enchanted Apples
Potion Effects
Netherite only
Bow cooldown
Crossbows
Respawn anchors
Beds explode
Border size
World border damage
Custom height limit
Everything configurable.
INVENTORY INVENTORY GUI System
Beautiful inventory GUIs.
Animations.
Page buttons.
Search.
Sorting.
Icons configurable.
Support custom model data.
Example GUIs:
Main Menu
Kit Browser
Kit Editor
Arena Browser
Party
Queue
Statistics
Leaderboards
Settings
Confirmation
Spectator Menu
Spectator Mode
Players may spectate duels.
Features:
Teleport INVENTORY INVENTORY GUI
Next duel
Previous duel
Hide players
Night vision
Speed
Leave button
Replay System (Optional)
Record duels.
Save replay.
Replay later.
API friendly.
Statistics
Track:
Wins
Losses
Draws
Kills
Deaths
Win Streak
Best Streak
Current Streak
KDR
Playtime
Favorite Kit
Favorite Arena
Damage Dealt
Damage Taken
Healing
Arrows Hit
Accuracy
Critical Hits
Longest Duel
Fastest Duel
Leaderboards
INVENTORY INVENTORY GUI
Holograms
Scoreboards
PlaceholderAPI
Top:
Wins
Kills
Playtime
Win Rate
Custom Kits
Scoreboard
Animated.
Shows:
Opponent
Kit
Arena
Time
Ping
Players Alive
World
Queue Position
Party
Arena Browser
Admins can browse generated arenas.
Shows:
Occupied
Empty
World
Coordinates
Players
Age
Reset Button
Delete Button
Teleport
Clone
Automatic Cleanup
Automatically remove:
Dropped items
Projectiles
XP
Mobs
Armor stands (optional)
Particles
Temporary blocks
Performance
Arena generation must be asynchronous whenever possible.
No lag spikes.
Reuse worlds.
Cache arenas.
Only paste schematics when needed.
Database
Support:
SQLite
MySQL
MariaDB
H2
Automatic migration.
PlaceholderAPI
Examples:
%zduels_wins%
%zduels_losses%
%zduels_streak%
%zduels_queue%
%zduels_rank%
%zduels_party%
%zduels_kills%
Permissions
Granular permissions.
Example:
zduels.admin
zduels.duel
zduels.party
zduels.kit.create
zduels.kit.publish
zduels.queue
zduels.spectate
zduels.reload
Admin Commands
/zduels startup
/zduels reload
/zduels arena
/zduels world
/zduels generate
/zduels delete
/zduels reset
/zduels stats
/zduels debug
/zduels migrate
/zduels backup
APIs
Provide an API for developers.
Events:
DuelStartEvent
DuelEndEvent
ArenaCreateEvent
ArenaResetEvent
KitCreateEvent
PartyCreateEvent
QueueJoinEvent
QueueLeaveEvent
Messages
All messages must use MiniMessage.
Everything configurable.
Support placeholders.
Support HEX colors.
Nice Extra Features
Implement additional premium-quality features that make ZDuels stand out:
ELO/MMR ranked matchmaking with divisions (Bronze, Silver, Gold, etc.)
Arena voting before the duel starts.
Kit rating system (like/dislike, star ratings).
Favorite kits and recently played kits.
Daily, weekly, and monthly quests (e.g., win 5 duels, play 10 matches).
Achievements with unlockable titles.
Cosmetics system (victory particles, kill effects, death animations, join messages).
Battle Pass framework (configurable and optional).
Player profiles with INVENTORY INVENTORY GUI statistics and achievements.
Clan/Guild support (optional module).
Tournament mode with automatic brackets and spectators.
Best-of-3 / Best-of-5 duel modes.
Rematch requests after a duel ends.
Anti-combat logging with configurable penalties.
Discord webhook integration for duel results and tournament announcements.
WebSocket/API support for future web dashboards.
Advanced logging and debug mode.
Localization support for multiple languages.
Backup system for configs and databases.
Plugin update checker (optional).
Hot config reloading without restarting the server.
Modular architecture, allowing features to be disabled individually.
Extensive JavaDocs and clean code comments.
Unit tests for critical systems where appropriate.
Final Goal
The finished plugin should feel like a modern, premium-quality duel plugin, comparable to commercial plugins while remaining lightweight, highly configurable, scalable, and easy to maintain. The standout feature must be its fully automated multi-world arena generation and management system, eliminating the need for server owners to manually build hundreds of arenas while still supporting custom schematics and extensive customization.
📄
pasted-code-1783691614647.txt
txt
67 lines
▶
make me a promt for my "ZDuels" minecraft plugin for paper 1.21+ for kodari.ai
tell the ai to make a simple plugin about creating pvp duels with command type configuration/file configuration (meaning it would be stored and could be edited in the config files).
# Config files:
1. Make sure the config files include
1. Setting a start position for both players ( + more players)
# Included commands (for players) (not admins):
1. /duel
2. /party
1. A simple party creation
2. /party invite to invite someone to theire party
3. /kit create
1. Make your own kits to play with friends
2. Ofc if players duel someone with a custom kit they are forced to have the same kit that was created (for no unfair advantages)
3. INVENTORY GUI base kit creation
4. World configuration
1. Only certain things can be configured so we dont have to make CUSTOM worlds for players
2. Example settings: Weather, Death drops, Locator Bar, Fall damage ect.
4. /kits (makes players avaible to play others kits) (displays other peoples kits) (only if someone makes theire custom kits public)
but what will be different from others is that it would make worlds (number of worlds depending on the startup configuration) (configurable on the first /zduels startup command) with arenas
what i mean is that it would make arenas on some criterias:
1. When a first duel is initialized
a) it would look into a configured world and look if any pvp arenas were created
b) if not it would create a pvp arena from a schematic or a default plains flat box (configurable on /zduels startup)
2\) If someone initializes a duel and a arena in the first world is full (someone is already in a pvp arena)
a) first it would check if there are more than 20 arenas in a world if not it would make a second arena
b) if there are more than 20 arenas it would then move to the second generated world where there it would make a new arena
c) if there are no players in any arenas it will stay idle until something happens.
Example:
/zduel startup
Output: Welcome to the .... bla bla bla. How many pvp worlds would you like to make?
Simple in chat input: 5
Ouput: Generating 5 worlds...
Output: Sucesfully generated 5 worlds. Teleport to worlds by /zduel world ((pvp-1),(pvp-2) etc.)
# You (chatgpt)
You are supposed to add even more features (cuz i got bored of typing more)
And make the final full promt for kodari ai
# ZDuels — Complete Development Prompt for Kodari AI
You are an expert Minecraft plugin developer. Build a simple, stable, production-ready Minecraft Paper plugin named **ZDuels** for **Paper 1.21+** using **Java 21**.
The plugin should provide configurable PvP duels, parties, custom kits, public kit browsing, and automatic PvP arena generation. The main unique feature is that server owners should not need to manually create hundreds of arenas. ZDuels must generate and recycle arenas automatically when players start duels.
Prioritize:
- Stability
- Simple and maintainable code
- Clean OOP architecture
- Modular managers and services
- File-based configuration
- Good performance
- Safe arena allocation and resetting
- A polished but reasonable feature set
- No unnecessary overengineering
Do not create an enormous unfinished framework. Implement complete, working foundations for the requested features.
---
# 1. Platform and Technical Requirements
- Plugin name: `ZDuels`
- Main package: `me.znetwork.zduels`
- Platform: Paper 1.21+
- Java: 21
- Use Adventure/MiniMessage for messages if supported by the existing project.
- Use XSeries for version-sensitive Minecraft materials, sounds, particles, enchantments, item flags, and similar Bukkit enums.
- Do not directly use version-sensitive Bukkit enum constants when XSeries can be used.
- Make the plugin compatible with normal Paper servers.
- Folia compatibility may be added only if it does not make the implementation unstable. Do not sacrifice reliability for Folia support.
- PlaceholderAPI support should be optional.
- WorldEdit/FAWE support should be optional.
- Vault support may be optional and should only be used if an actual economy or permission feature is implemented.
- Use Gradle.
- Do not use Maven unless the existing project already uses Maven.
- Do not shade or relocate server APIs.
- Do not add libraries that are not actually used.
- Do not create duplicate classes if they already exist in the project.
- Inspect the existing project before creating files and preserve its existing conventions.
---
# 2. Main Goal
Create a duel plugin where players can:
- Challenge another player
- Accept or deny duel requests
- Select a configured kit
- Use custom kits
- Create simple parties
- Queue for duels
- Spectate active duels
- View statistics
- Browse public kits
- Play in automatically generated and recycled arenas
The plugin must automatically find or create an available arena when a duel starts.
---
# 3. Configuration-First Design
Everything reasonably configurable must be stored in YAML files.
Do not hardcode:
- Messages
- GUI titles
- GUI item names
- GUI item materials
- Duel countdowns
- Request expiration times
- Arena limits
- World generation settings
- Arena sizes
- Spawn positions
- Kit rules
- Party limits
- Queue settings
- World rules
- Permissions where practical
- Sound and particle effects
- Statistics messages
- Command aliases where supported
Use separate configuration files instead of putting every setting into one large file.
Generate these files on first startup:
```text
config.yml
messages.yml
commands.yml
arenas.yml
worlds.yml
kits.yml
parties.yml
queue.yml
gui.yml
database.yml
effects.yml
scoreboard.yml
If a configuration file does not exist, create it from the plugin’s defaults.
The /zduels reload command must reload configuration files without restarting whenever possible.
4. Required Configuration Files
config.yml
Include general settings such as:
debug: false
language: en
request-expiration-seconds: 60
duel-countdown-seconds: 5
allow-spectators: true
allow-rematch: true
save-player-inventories: true
restore-player-state: true
commands.yml
Allow command-related behavior to be configured, including:
Request expiration
Cooldowns
Maximum duel distance
Whether players can duel during combat
Whether players can duel in protected regions
Command aliases where technically possible
Confirmation requirements
Messages shown when commands are used
The actual Bukkit command registrations must still be declared correctly in plugin.yml.
worlds.yml
Configure automatically generated PvP worlds:
world-generation:
enabled: true
world-count: 3
world-name-format: "pvp-{number}"
environment: NORMAL
generate-structures: false
seed-mode: RANDOM
fixed-seed: 0
generator: VOID
load-on-startup: true
unload-unused-worlds: false
arena-limits:
max-arenas-per-world: 20
max-total-arenas: 100
create-arena-on-demand: true
default-arena:
generation-method: FLAT_BOX
size: 75
height: 20
floor-material: BEDROCK
inside-material: AIR
wall-material: BARRIER
ceiling-enabled: false
spectator-platform-enabled: true
world-rules:
weather: CLEAR
time: 6000
do-daylight-cycle: false
do-weather-cycle: false
do-mob-spawning: false
do-fire-tick: false
keep-inventory: true
natural-regeneration: false
arenas.yml
This file must store generated arena data, including:
Arena ID
World name
Status
Center location
Size
Spawn locations
Spectator location
Minimum and maximum height
Generation method
Schematic name if applicable
Creation time
Last reset time
Current duel ID if occupied
Example:
arenas:
arena-1:
world: pvp-1
status: AVAILABLE
generation-method: FLAT_BOX
center:
x: 0.5
y: 100.0
z: 0.5
size: 75
spawns:
team-1:
- x: -20.5
y: 101.0
z: 0.5
yaw: 90.0
pitch: 0.0
team-2:
- x: 20.5
y: 101.0
z: 0.5
yaw: -90.0
pitch: 0.0
spectator:
x: 0.5
y: 115.0
z: 0.5
yaw: 0.0
pitch: 90.0
The configuration must support:
Two-player duels
Multiple players per team
Multiple teams
Future party-versus-party duels
Do not assume every arena only has two spawn locations.
kits.yml
Store default kits and custom kit settings.
Each kit should support:
Name
Display name
Icon
Inventory contents
Armor contents
Offhand item
Potion effects
Food level
Saturation
Health
Experience
Public/private status
Owner UUID
Description
Category
Creation date
Last updated date
Usage count
Rating
Allowed team size
World rules
Players must receive an exact copy of the selected kit. The opponent must receive the same kit contents and rules to prevent unfair advantages.
parties.yml
Configure:
Maximum party size
Invite expiration
Whether offline invites are allowed
Friendly fire
Party chat format
Party-versus-party requirements
Whether party leaders can transfer leadership
queue.yml
Configure queues such as:
Unranked
Ranked foundation
Sword
Crystal
Boxing
Custom kits
Each queue should support:
Minimum party size
Maximum party size
Required kit
Matchmaking timeout
Maximum ping if implemented
Whether parties are allowed
Whether spectators are allowed
gui.yml
Configure:
GUI titles
GUI sizes
Button slots
Button materials
Button names
Button lore
Sounds
Pagination
Filler items
Confirmation menus
Search and filter controls
Use a reusable inventory GUI system with:
Lazy inventory creation
Button slot handlers
Central GUI manager
Automatic event registration
Safe inventory click cancellation
Automatic cleanup when inventories close
Do not identify GUIs only by their title. Track their actual inventory instances or another reliable identifier.
database.yml
Use SQLite by default for persistent player statistics and custom kits.
Support a clean storage abstraction so another database can be added later.
Store at minimum:
UUID
Name
Wins
Losses
Draws
Kills
Deaths
Current streak
Best streak
ELO/MMR foundation
Playtime
Favorite kit
Last played time
Do not perform database operations synchronously on the main server thread.
effects.yml
Configure:
Duel start sounds
Countdown sounds
Victory effects
Defeat effects
Kill effects
Rematch sounds
Queue join sounds
Queue leave sounds
GUI click sounds
Particles
Victory messages
scoreboard.yml
Make the scoreboard optional and configurable.
Support placeholders such as:
Opponent
Kit
Arena
Duel time
Players alive
Current score
Queue position
Party size
5. Startup Wizard
Add:
/zduels startup
Permission:
zduels.admin
The startup wizard should guide an administrator through initial setup.
At minimum, ask:
How many PvP worlds should be created?
What arena generation method should be used?
What is the maximum number of arenas per world?
What should the arena size be?
Should a schematic be used?
What should the world names be?
Should the worlds load automatically?
Example flow:
Welcome to ZDuels setup.
How many PvP worlds should be generated?
Type a number or type cancel.
What arena generation method should be used?
1. Flat Box
2. Schematic
What is the maximum number of arenas per world?
What arena size should be used?
Generating worlds...
Successfully generated:
- pvp-1
- pvp-2
- pvp-3
Setup complete.
Requirements:
Only the administrator who started setup can answer the prompts.
Add a timeout.
Add a
canceloption.Prevent multiple setup sessions at the same time.
Validate numeric input.
Save the selected settings into YAML.
Do not block the main server thread unnecessarily.
World creation and Bukkit world operations must respect Paper’s threading rules.
If a world cannot be generated, show a useful error and continue or stop safely.
The wizard must be usable again to update settings without corrupting existing arenas.
Also support a non-interactive configuration fallback so server owners can configure everything manually.
6. Dynamic World and Arena System
This is the main feature.
World Creation
During setup, create worlds such as:
pvp-1
pvp-2
pvp-3
The number of worlds must be configurable.
Each world may contain multiple arenas.
Arenas must be placed in separate coordinates so that players from different duels cannot interfere with one another.
Use a configurable spacing value.
Arena Allocation
When a duel starts:
Search configured PvP worlds in order.
Search for an available arena.
If an available arena exists, allocate it.
If no arena is available and the current world has fewer than the configured maximum, generate a new arena.
If the current world has reached its arena limit, check the next configured world.
If every world is full, add the duel request or queue entry to the configured queue.
When an arena becomes available, start the next valid duel.
Arena statuses should include:
AVAILABLE
GENERATING
RESETTING
OCCUPIED
DISABLED
Use thread-safe collections or synchronized access where necessary because queue and arena state may be accessed by scheduled tasks.
Flat Box Arena
The default generation method should create:
Bedrock floor
Configurable interior block
Configurable walls
Optional ceiling
Optional spectator platform
Configurable world border
Spawn locations
Arena center
Safe separation from other arenas
Optional decorative blocks
Optional barriers
The arena size, height, materials, and spacing must be configurable.
Schematic Arena
If WorldEdit or FAWE is installed and schematic mode is selected:
Load a configured schematic from the plugin directory.
Paste it at the allocated arena location.
Support
.schemfiles where possible.Allow the schematic name to be configured.
Store the pasted arena’s bounds.
Support configured marker locations or marker blocks for:
SPAWN_1SPAWN_2SPAWN_3SPAWN_4CENTERSPECTATOR
If WorldEdit/FAWE is missing, show a clear message and safely fall back to the configured flat arena method if fallback is enabled.
Do not make WorldEdit a required dependency.
Arena Reset
After a duel ends:
Remove players, spectators, mobs, projectiles, dropped items, XP, temporary entities, and temporary blocks.
Restore the arena to its original state.
Reset weather.
Reset time.
Reset world border.
Reset fire.
Reset temporary effects.
Reset block changes.
Restore configured gamerules.
Mark the arena as available only after reset is complete.
Ensure the next duel cannot enter an arena while it is resetting.
For flat arenas, reset by clearing and rebuilding the arena.
For schematic arenas, repaste or restore the schematic.
Avoid unnecessary full-world regeneration.
7. Arena Spawn Configuration
Support configurable spawn positions for:
Player 1
Player 2
Additional players
Multiple teams
Spectators
Center location
Optional pre-duel positions
Example:
spawn-points:
team-1:
- "0,101,-20,0,0"
- "-2,101,-20,0,0"
team-2:
- "0,101,20,180,0"
- "2,101,20,180,0"
spectators:
- "0,115,0,0,90"
Also provide an administrator command to set positions in an arena:
/zduels arena setspawn <arena> <team> <index>
/zduels arena setspectator <arena>
/zduels arena setcenter <arena>
8. Duel System
Implement a complete basic duel lifecycle:
Player sends a duel request.
Target receives the request.
Target accepts or denies.
Both players are checked for eligibility.
An arena is allocated.
The selected kit is loaded.
Player inventories and states are saved.
Players are teleported to their spawns.
A countdown begins.
PvP becomes active.
The duel ends when a player dies, leaves, or another configured win condition occurs.
Statistics are updated.
Players are restored.
The arena is reset.
A rematch option is shown if enabled.
Support:
1v1 duels
Party versus party foundation
Multiple players per team
Team names
Team colors
Configurable duel countdown
Time limit
Draw on timeout
Spectators
Rematch requests
Duel leave command
Disconnect handling
Combat logging handling
Inventory and player state restoration
Required commands:
/duel <player>
/duel accept [player]
/duel deny [player]
/duel leave
/duel spectate <player>
/duel rematch
/duel stats [player]
/duel history
/duel top
/duel random
/duel queue [queue]
The plugin should prevent players from:
Accepting multiple duels
Joining while already in a duel
Joining while dead
Starting a duel with themselves
Starting a duel with an offline target unless configured
Entering an arena that is not ready
Retaining modified inventory items after a duel
Interacting with protected arena regions incorrectly
Escaping the duel arena during an active match
9. Party System
Implement a simple party system.
Required commands:
/party create
/party invite <player>
/party accept <player>
/party deny <player>
/party leave
/party kick <player>
/party promote <player>
/party disband
/party list
/party chat [message]
/party duel <party>
Features:
Party leader
Party members
Invite expiration
Party chat
Party disbanding
Leadership transfer
Configurable party size
Friendly-fire toggle
Party versus party foundation
Players cannot be in multiple parties
Party state cleanup when members leave
Only party leaders should be able to start a party duel unless configured otherwise.
10. Custom Kits
Implement:
/kit create <name>
/kit edit <name>
/kit delete <name>
/kit rename <old> <new>
/kit clone <source> <target>
/kit publish <name>
/kit private <name>
/kit list
/kits
Kit creation must use an inventory GUI.
The GUI should allow players to:
Set inventory contents
Set armor
Set offhand
Set potion effects
Set food
Set health
Set experience
Set kit icon
Set description
Set category
Save the kit
Cancel editing
Preview the kit
Clone an existing kit
Delete a kit with confirmation
Custom kits must be saved persistently.
When a kit is used in a duel:
Both sides receive the exact same kit.
The original item stacks must not be shared by reference.
Items must be cloned correctly.
Kit rules must apply equally to all players.
Private kits must only be usable by permitted players.
Public kits must be visible in
/kits.
Include kit validation to prevent invalid or impossible kit data.
11. Public Kit Browser
Implement /kits as a configurable inventory GUI.
Include:
Public kits only
Pagination
Kit owner
Kit name
Description
Category
Usage count
Rating
Favorite option
Preview button
Use/challenge button
Sort by newest
Sort by most played
Sort by rating
Category filtering
Search if practical
Do not allow players to edit another player’s kit.
Add configurable permissions for publishing kits and using custom kits.
12. Kit World Rules
Each kit may define allowed world and duel rules.
Only implement rules that can be applied safely without creating custom worlds for every player.
Support configurable options such as:
Weather
Time
Keep inventory
Death drops
Mob spawning
Natural regeneration
Fire spread
Explosion damage
Block breaking
Block placing
Fall damage
Void damage
Fire damage
Drowning
Hunger
Elytra
Totems
Ender pearls
Shields
Golden apples
Enchanted golden apples
Potion effects
Respawn anchors
Bed explosions
Locator bar if available
Coordinate visibility if supported
World border size
World border damage
Apply rules only during the duel and restore the player’s previous state afterward.
Do not globally modify unrelated worlds.
13. Spectator System
Implement:
/duel spectate <player>
Spectators should:
Be placed in spectator mode
Be teleported to the spectator location
Be unable to affect the duel
Be unable to pick up items
Be unable to modify blocks
Be hidden or visible according to configuration
Have a simple spectator GUI
Be able to leave safely
The spectator GUI may include:
Teleport to player 1
Teleport to player 2
Next player
Previous player
Hide players
Night vision
Speed
Leave spectator mode
14. Statistics and Leaderboards
Track:
Wins
Losses
Draws
Kills
Deaths
Current win streak
Best win streak
KDR
Playtime
Favorite kit
Favorite arena
Damage dealt if practical
Damage taken if practical
Fastest win
Longest duel
ELO/MMR foundation
Add:
/duel stats [player]
/duel history
/duel top
Create configurable leaderboards for:
Wins
Kills
Win rate
Current streak
Best streak
ELO/MMR
Playtime
Do database work asynchronously.
Do not allow duplicate statistic updates if a duel-ending event is fired more than once.
15. Optional Ranked Foundation
Add a lightweight ranked foundation if it can be implemented cleanly:
ELO/MMR value
Ranked and unranked queues
Basic divisions:
Bronze
Silver
Gold
Platinum
Diamond
Configurable division thresholds
MMR updates after a completed ranked duel
Do not build a complicated tournament or battle-pass system unless the core duel system is already complete and stable.
16. Queue and Matchmaking
Implement queues for:
Unranked
Ranked
Sword
Crystal
Boxing
Custom kits
Players may join with:
/duel queue <queue>
Queue requirements:
Do not allow duplicate queue entries.
Remove players when they leave.
Remove offline players.
Remove players who start another duel.
Match compatible players or parties.
Respect queue configuration.
Show queue position.
Allocate an arena automatically when a match is found.
If no arena is currently available, keep the match waiting without corrupting queue state.
Add configurable queue timeout.
Provide queue leave functionality.
17. Admin Commands
Implement:
/zduels startup
/zduels reload
/zduels debug
/zduels stats [player]
/zduels generate
/zduels world list
/zduels world tp <world>
/zduels arena list
/zduels arena info <arena>
/zduels arena reset <arena>
/zduels arena delete <arena>
/zduels arena disable <arena>
/zduels arena enable <arena>
/zduels arena setspawn <arena> <team> <index>
/zduels arena setspectator <arena>
/zduels arena setcenter <arena>
/zduels backup
Permissions:
zduels.admin
zduels.reload
zduels.startup
zduels.debug
zduels.arena
zduels.world
zduels.duel
zduels.party
zduels.kit.create
zduels.kit.publish
zduels.queue
zduels.spectate
zduels.stats
Make permissions configurable where practical.
18. Messages
All player-facing messages must be configurable in messages.yml.
Support:
Legacy color codes if the existing project uses them
MiniMessage if the project is configured for it
HEX colors
Placeholders
Error messages
Success messages
Duel requests
Countdown messages
Arena messages
Queue messages
Party messages
Kit messages
Admin messages
Use a centralized message utility instead of hardcoding messages throughout the plugin.
19. PlaceholderAPI
If PlaceholderAPI is installed, register an optional expansion with placeholders such as:
%zduels_wins%
%zduels_losses%
%zduels_draws%
%zduels_kills%
%zduels_deaths%
%zduels_streak%
%zduels_best_streak%
%zduels_elo%
%zduels_queue%
%zduels_party%
%zduels_kit%
%zduels_arena%
%zduels_in_duel%
The plugin must still work normally when PlaceholderAPI is not installed.
20. Events and API
Create an API for other plugins.
Provide events such as:
DuelStartEvent
DuelEndEvent
ArenaCreateEvent
ArenaResetEvent
QueueJoinEvent
QueueLeaveEvent
KitCreateEvent
PartyCreateEvent
Events should expose useful information such as:
Players
Teams
Kit
Arena
Duel result
Winner
Loser
Queue
Party
Use cancellable events where cancellation makes sense, such as duel start and arena creation.
21. Recommended Architecture
Use clean, separated classes such as:
me.znetwork.zduels
├── ZDuels.java
├── command
├── config
├── arena
├── world
├── duel
├── queue
├── party
├── kit
├── gui
├── stats
├── listener
├── placeholder
├── database
├── api
└── util
Suggested managers/services:
ConfigManager
MessageManager
ArenaManager
ArenaGenerationService
ArenaResetService
WorldManager
DuelManager
DuelRequestManager
QueueManager
PartyManager
KitManager
StatsManager
DatabaseManager
GUIManager
SpectatorManager
PlaceholderManager
Do not create abstractions that are not used.
Every manager must be initialized and registered correctly from the main plugin class.
Do not leave dangling method calls, missing constructors, missing imports, or unregistered listeners.
22. Performance and Threading
The plugin should support servers with many players.
Requirements:
Do not perform database queries synchronously.
Do not scan entire worlds unnecessarily.
Cache arena metadata.
Reuse arenas.
Avoid repeatedly loading and unloading worlds.
Use scheduled tasks for countdowns and cleanup.
Perform only thread-safe work asynchronously.
Keep Bukkit world, entity, inventory, and teleport operations on the correct server thread.
Prevent duplicate arena allocation.
Prevent duplicate duel completion.
Avoid memory leaks when players disconnect.
Clean up requests, parties, queues, spectators, and active duels.
Do not claim that Bukkit world modification is asynchronous if it is not safe on Paper.
23. Player State Safety
Before a duel, save the player’s relevant state:
Inventory
Armor
Offhand
Health
Food
Saturation
Experience
Game mode
Location
Potion effects
Fire ticks
Flight state
Allow-flight state
Fall distance
Visibility state
Previous world
After a duel:
Restore the saved state.
Remove temporary duel effects.
Return players to their previous location or configured lobby.
Handle disconnects safely.
Avoid item duplication.
Ensure restoration occurs only once.
If a player cannot be restored immediately, store enough information to restore them on next join.
24. plugin.yml
Create a valid plugin.yml containing:
Plugin name
Version
Main class
API version compatible with Paper 1.21+
Author
Soft dependencies for PlaceholderAPI and WorldEdit/FAWE if used
All required commands
Permissions
Helpful command descriptions and usage
Use the correct command names consistently. Use /zduels for administrative commands and /duel, /party, /kit, and /kits for player commands.
25. Acceptance Criteria
The implementation is complete only if:
The project compiles successfully with Java 21.
The plugin enables without exceptions.
All default YAML files are generated correctly.
/zduels startupworks with chat input and cancellation.Configured PvP worlds can be created.
An arena is generated on demand.
A second arena is generated when the first is occupied.
The next world is used after a world reaches its arena limit.
Players are queued when all arenas are unavailable.
Arenas reset safely after duels.
/duelrequests work.Duel countdowns work.
Players receive identical kits.
Player state is restored after a duel.
Parties can be created and invited.
Custom kits can be created through a GUI.
Public kits appear in
/kits.Spectators can join and leave safely.
Statistics are saved.
Reloading configuration does not corrupt active duels.
Missing optional plugins do not crash ZDuels.
No methods, classes, imports, commands, or listeners are left incomplete.
No placeholder implementations such as empty methods or “TODO” logic remain in the core systems.
The code does not include large unnecessary systems that are not fully implemented.
Before finishing, inspect the complete project for compilation errors, missing references, incorrect package names, invalid Paper APIs, unsafe asynchronous Bukkit calls, and duplicate classes.
Create complete working files only. Do not summarize code with comments such as “the rest of the class goes here.” Do not provide pseudocode for required features.
implement everything you just said to the plugin
Please paste the feature list or previous response you want implemented—the requirements aren’t included in this conversation.
The compilation failed with this error:
Compilation failed with 3 error(s):
ERROR in src/main/java/me/znetwork/zduels/duel/Duel.java at line 48: invalid method declaration; return type required
public Duel(Player first, Player second, Arena arena, String kit) {
^
ERROR in src/main/java/me/znetwork/zduels/duel/Duel.java at line 66: class, interface, enum, or record expected
}
^
ERROR in src/main/java/me/znetwork/zduels/duel/Duel.java at line 1: compact source file should not have package declaration
package me.znetwork.zduels.duel;
^
=== COMPILATION ERROR ANALYSIS ===
SYNTAX ERRORS:
- Line 66: class, interface, enum, or record expected
ACTION: Check for missing semicolons or brackets
FILES TO INVESTIGATE:
- src/main/java/me/znetwork/zduels/duel/Duel.java
Please fix this error by creating a new artifact with the corrected code.
Fixed src/main/java/me/znetwork/zduels/duel/Duel.java by removing the duplicated class definition and restoring valid Java syntax.
pls implement kit creation via the INVENTORY GUI please i need this console outputed ts so fix ts:
📄
pasted-code-1783701229806.txt
txt
37 lines
▶
[18:32:18 ERROR]: Command exception: /duel accept
org.bukkit.command.CommandException: Unhandled exception executing command 'duel' in plugin ZDuels v1.0.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.21.11-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:83) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.3.10.jar:?]
at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:30) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.commands.execution.CommandQueueEntry.execute(CommandQueueEntry.java:5) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:104) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:469) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.commands.Commands.performCommand(Commands.java:374) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.commands.Commands.performCommand(Commands.java:362) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.server.network.ServerGamePacketListenerImpl.performUnsignedChatCommand(ServerGamePacketListenerImpl.java:2375) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$12(ServerGamePacketListenerImpl.java:2348) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:177) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1525) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:188) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:151) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1505) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1499) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.server.MinecraftServer.recordTaskExecutionTimeWhileWaiting(MinecraftServer.java:1225) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1341) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:388) ~[paper-1.21.11.jar:1.21.11-132-c5eb079]
at java.base/java.lang.Thread.run(Thread.java:1474) ~[?:?]
Caused by: java.lang.IllegalAccessError: class me.znetwork.zduels.arena.ArenaManager tried to access private method 'void me.znetwork.zduels.arena.ArenaManager$WorldBorderSettings.apply(org.bukkit.World, double, double, double)' (me.znetwork.zduels.arena.ArenaManager and me.znetwork.zduels.arena.ArenaManager$WorldBorderSettings are in unnamed module of loader 'ZDuels-1.0.0.jar' @4b7f0902)
at ZDuels-1.0.0.jar//me.znetwork.zduels.arena.ArenaManager.buildArena(ArenaManager.java:192) ~[?:?]
at ZDuels-1.0.0.jar//me.znetwork.zduels.arena.ArenaManager.createArena(ArenaManager.java:118) ~[?:?]
at ZDuels-1.0.0.jar//me.znetwork.zduels.arena.ArenaManager.allocate(ArenaManager.java:56) ~[?:?]
at ZDuels-1.0.0.jar//me.znetwork.zduels.duel.DuelManager.startMatch(DuelManager.java:99) ~[?:?]
at ZDuels-1.0.0.jar//me.znetwork.zduels.duel.DuelManager.accept(DuelManager.java:77) ~[?:?]
at ZDuels-1.0.0.jar//me.znetwork.zduels.commands.DuelCommand.onCommand(DuelCommand.java:41) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.21.11-R0.1-SNAPSHOT.jar:?]
... 24 more
Add inventory-based kit creation and wire it into the existing plugin flow.
Fix the
WorldBorderSettings.applyaccess error shown in the/duel acceptstack trace.
The existing project already contains partial kit GUI classes, but they are not wired into the main menu or command. I’m replacing the incomplete wiring with a working /zduels kit create <name> flow and connecting the kits menu to it, while preserving the existing editor behavior.
Implemented the kit creation GUI flow and fixed the /duel accept crash.
Changes include:
Added
/zduels kitand/zduels kit create <name>.Connected the main menu’s Kits button to the kit list GUI.
Added inventory-based kit editing:
Place items in the first 36 slots.
Configure armor in slots 36–39.
Save with Save Kit.
Cancel with Cancel.
Added kit validation and duplicate-name checks.
Added persistent kit saving to
kits.yml.Added missing kit messages.
Added inventory drag protection for GUI controls.
Registered and injected
KitManager.Fixed the
WorldBorderSettings.apply(...)access error by making the method accessible fromArenaManager.Added the missing
GUIManagerimport inZDuelsCommand.
Usage:
/zduels
/zduels kit
/zduels kit create <name>
The local project does not include a Gradle wrapper, so ./gradlew compileJava could not be run here.
package me.znetwork.zduels;
import me.znetwork.zduels.arena.ArenaManager;
import me.znetwork.zduels.commands.DuelCommand;
import me.znetwork.zduels.commands.ZDuelsCommand;
import me.znetwork.zduels.config.ConfigManager;
import me.znetwork.zduels.duel.DuelManager;
import me.znetwork.zduels.duel.KitManager;
import me.znetwork.zduels.gui.GUIListener;
import me.znetwork.zduels.gui.GUIManager;
import me.znetwork.zduels.listeners.DuelListener;
import me.znetwork.zduels.placeholder.ZDuelsExpansion;
import me.znetwork.zduels.queue.QueueManager;
import me.znetwork.zduels.stats.StatsManager;
import me.znetwork.zduels.util.MessageUtil;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public final class ZDuels extends JavaPlugin {
private ConfigManager configManager;
private MessageUtil messageUtil;
private ArenaManager arenaManager;
private StatsManager statsManager;
private DuelManager duelManager;
private QueueManager queueManager;
private GUIManager guiManager;
private KitManager kitManager;
@Override
public void onEnable() {
this.configManager = new ConfigManager(this);
this.configManager.load();
this.messageUtil = new MessageUtil(this.configManager);
this.arenaManager = new ArenaManager(this, this.configManager);
this.statsManager = new StatsManager(this);
this.duelManager = new DuelManager(this, this.configManager, this.messageUtil, this.arenaManager, this.statsManager);
this.queueManager = new QueueManager(this, this.configManager, this.messageUtil, this.duelManager);
this.guiManager = new GUIManager();
this.kitManager = new KitManager(this.configManager);
Bukkit.getPluginManager().registerEvents(new DuelListener(this, this.duelManager), this);
Bukkit.getPluginManager().registerEvents(new GUIListener(this.guiManager), this);
DuelCommand duelCommand = new DuelCommand(this.messageUtil, this.duelManager, this.queueManager);
ZDuelsCommand zDuelsCommand = new ZDuelsCommand(this, this.messageUtil, this.guiManager, this.arenaManager, this.kitManager);
getCommand("duel").setExecutor(duelCommand);
getCommand("zduels").setExecutor(zDuelsCommand);
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
new ZDuelsExpansion(this).register();
}
}
@Override
public void onDisable() {
if (this.statsManager != null) {
this.statsManager.save();
}
}
public void reloadPlugin() {
this.configManager.reload();
this.messageUtil.reload();
this.arenaManager.reload();
this.queueManager.reload();
}
public ConfigManager getConfigManager() {
return this.configManager;
}
public MessageUtil getMessageUtil() {
return this.messageUtil;
}
public ArenaManager getArenaManager() {
return this.arenaManager;
}
public StatsManager getStatsManager() {
return this.statsManager;
}
public DuelManager getDuelManager() {
return this.duelManager;
}
public QueueManager getQueueManager() {
return this.queueManager;
}
public KitManager getKitManager() {
return this.kitManager;
}
public GUIManager getGuiManager() {
return this.guiManager;
}
}