📄
pasted-code-1789434490525.txt
txt
2372 lines
▶
BUILD A COMPLETE PROFESSIONAL MINECRAFT PVP / DUELS PLUGIN
PLUGIN NAME:
MythrionDuels
FINAL JAR:
mythrionduels.jar
I WANT A REAL PRODUCTION-READY PLUGIN, NOT A DEMO.
IMPORTANT:
Do not only generate source code.
Build the complete project.
Compile the actual JAR.
Test the build.
Fix compilation errors yourself.
Verify the final JAR exists and is a valid JAR before giving it to me.
==================================================
1. SERVER TARGET
==================================================
Primary target:
Minecraft 26.2
Paper 26.2
Java 25
Must support:
Paper
Folia
Must work with:
ViaVersion
ViaBackwards
Geyser
Floodgate
These plugins must be OPTIONAL.
The plugin must NOT crash if they are not installed.
Do NOT require client-side mods.
Do NOT use Forge-specific code inside the Paper plugin.
For modded/Forge clients connecting through a compatible server/proxy setup, the plugin should simply behave like a normal Paper plugin.
==================================================
2. API SAFETY
==================================================
Use the REAL Paper 26.2 API.
Do NOT create fake Bukkit classes.
Do NOT create fake Paper classes.
Do NOT package:
org.bukkit.*
io.papermc.*
net.kyori.*
inside the final JAR.
Paper API must be compileOnly/provided.
Avoid NMS completely if possible.
Use modern Bukkit/Paper APIs.
Use Adventure Components correctly.
Do NOT use invalid/deprecated method signatures just to make compilation work.
==================================================
3. ONLY ONE MAIN COMMAND
==================================================
The main command must be:
/duels
Optional aliases are NOT wanted.
Do not create random extra commands.
The entire system should be controlled through the GUI.
==================================================
4. MAIN DUELS GUI
==================================================
When a player executes:
/duels
open a professional GUI.
Title:
"✦ MYTHRION DUELS ✦"
Make it look like a premium Minecraft network GUI.
Main choices:
SOLO DUELS
TEAM DUELS
RANDOM DUEL
QUEUE
PARTY
MY SETTINGS
LEAVE DUEL / LEAVE QUEUE when applicable
Use attractive Minecraft item icons.
Do not make the GUI cluttered.
Use decorative panes carefully.
Use modern item names and lore.
==================================================
5. SOLO DUELS
==================================================
When the player selects SOLO DUELS:
Show all available PvP modes.
PvP modes:
1. SPEAR + ELYTRA
2. MACE + ELYTRA
3. SPEAR + MACE
4. TNT MINECART
5. SWORD ONLY
6. SWORD OP
7. TNT MINECART PVP
8. CRYSTAL PVP
9. ANCHOR PVP
10. AXE PVP
11. FIST / HANDS ONLY
Also make the architecture easy to add more modes later.
Each mode must have:
- icon
- display name
- description
- queue button
- permission
- world
- kit
- protection settings
==================================================
6. TEAM DUELS
==================================================
Add:
TEAM DUELS
Players can create/join a team duel.
Maximum:
4 players per team.
Maximum total team duel:
8 players.
Examples:
2 players:
1v1
4 players:
2v2
6 players:
3v3
7 players:
3v4
8 players:
4v4
For odd numbers:
Randomly distribute players between RED and BLUE.
Example:
7 players:
RED:
3
BLUE:
4
The system must NOT allow:
5v2 if balanced 4v3 is possible.
Use a fair random team assignment.
==================================================
7. TEAM COLORS
==================================================
Team 1:
RED
Team 2:
BLUE
Show team color in:
GUI
scoreboard
messages
titles
action bar
team announcements
Example:
RED TEAM
BLUE TEAM
Players should clearly know their team.
==================================================
8. TEAM QUEUE
==================================================
Players can queue for:
2v2
3v3
4v4
and potentially dynamic team sizes.
Queue system must match players looking for the same:
PvP mode
team size
Example:
Player A queues:
2v2 Sword
Player B queues:
2v2 Sword
Player C queues:
2v2 Sword
Player D queues:
2v2 Sword
Start match.
Do NOT match:
Sword queue with Crystal queue.
==================================================
9. RANDOM DUEL
==================================================
Add:
RANDOM DUEL
Player chooses:
SOLO RANDOM
or:
TEAM RANDOM
The system randomly chooses an available PvP mode.
Example:
Player chooses Random.
System chooses:
Crystal PvP
Then searches for another player in the same random pool.
Once matched:
randomly select a compatible PvP mode.
Show:
"⚔ MATCH FOUND!"
Then show:
"Crystal PvP"
==================================================
10. QUEUE GUI
==================================================
When a player joins a queue:
Show:
"SEARCHING FOR OPPONENT..."
PvP mode:
Sword PvP
Players waiting:
3
Elapsed time:
12 seconds
Buttons:
LEAVE QUEUE
BACK
Do not allow the player to join multiple incompatible queues simultaneously.
A player can only be in ONE duel queue at a time.
==================================================
11. MATCH FOUND
==================================================
When a match is found:
Show a large title:
"MATCH FOUND!"
Subtitle:
"SWORD PVP"
Then teleport both players to the configured world.
Example:
config.yml:
worlds:
sword:
world: duel_sword
spawn1:
x: 100
y: 70
z: 100
spawn2:
x: -100
y: 70
z: -100
==================================================
12. WORLD CONFIGURATION
==================================================
This is VERY IMPORTANT.
I want to easily control every duel world from:
config.yml
Example:
worlds:
spear_elytra:
world: duel_spear_elytra
spawn1:
x: 0
y: 100
z: 50
yaw: 90
pitch: 0
spawn2:
x: 0
y: 100
z: -50
yaw: -90
pitch: 0
mace_elytra:
world: duel_mace_elytra
spawn1:
x: 0
y: 100
z: 50
yaw: 90
pitch: 0
spawn2:
x: 0
y: 100
z: -50
yaw: -90
pitch: 0
spear_mace:
world: duel_spear_mace
sword:
world: duel_sword
sword_op:
world: duel_sword_op
crystal:
world: duel_crystal
anchor:
world: duel_anchor
axe:
world: duel_axe
fist:
world: duel_fist
tnt:
world: duel_tnt
Team modes should also be able to use configured worlds.
Example:
team_worlds:
sword:
world: team_sword
crystal:
world: team_crystal
If a world is missing:
DO NOT crash the server.
Show an error in console and cancel the match safely.
==================================================
13. DUEL ARENAS
==================================================
Support multiple arenas per PvP mode.
Example:
sword:
- sword_1
- sword_2
- sword_3
When a match starts:
Automatically choose an available arena.
Two matches must NEVER use the same arena simultaneously.
When the match ends:
Mark arena as available.
This allows multiple simultaneous matches.
==================================================
14. SPEAR + ELYTRA KIT
==================================================
Create a complete kit specifically designed for:
Spear + Elytra.
Give the appropriate armor and items.
Include enchantments appropriate for the mode.
Do NOT accidentally give incompatible items.
Allow all kit values to be configured.
==================================================
15. MACE + ELYTRA
==================================================
Complete Mace + Elytra kit.
Include:
Mace
Elytra
armor
healing
food
appropriate enchantments
support items
Kit must be balanced for Mace PvP.
==================================================
16. SPEAR + MACE
==================================================
Give:
Spear
Mace
appropriate armor
appropriate enchantments
healing/support items
==================================================
17. SWORD ONLY PVP
==================================================
Mode:
SWORD ONLY
Player receives:
Sword
full armor
food
appropriate healing/support
No:
Mace
Spear
Crystal
Anchor
Bow
Crossbow
unless specifically configured.
==================================================
18. SWORD OP PVP
==================================================
Mode:
SWORD OP
Use:
Netherite armor
Netherite sword
strong enchantments
splash healing
splash regeneration if configured
golden apples if configured
other configured support items
Make it an OP sword kit.
==================================================
19. TNT MINECART PVP
==================================================
Create a TNT Minecart PvP mode.
Give appropriate:
TNT minecarts
rails
building blocks
armor
weapons
support items
All values configurable.
Prevent the plugin from accidentally creating permanent destructive damage outside the configured arena.
==================================================
20. CRYSTAL PVP
==================================================
Complete Crystal PvP kit.
Include:
Netherite armor
Netherite sword
End Crystals
Obsidian
Totems
Golden Apples
Ender Pearls
appropriate tools
healing/support items
Everything configurable.
==================================================
21. ANCHOR PVP
==================================================
Complete Respawn Anchor PvP kit.
Include:
Respawn Anchors
Glowstone
Obsidian if required
Totems
Pearls
Golden Apples
armor
weapons
support items
Prevent players from using the kit to affect worlds outside the duel arena.
==================================================
22. AXE PVP
==================================================
Complete Axe PvP kit.
Include:
Axe
armor
Bow
Crossbow
arrows
IMPORTANT:
Give exactly:
8 arrows
unless changed in config.
Also include appropriate enchantments and support items.
==================================================
23. FIST / HANDS ONLY
==================================================
Create:
FIST PVP
No weapon.
No armor.
No kit.
Players fight using their hands only.
The GUI icon should be a:
PLAYER HEAD
Make the icon visually represent a fist/punch theme using a player head if possible.
Do not give the player weapons.
==================================================
24. MORE PVP MODES
==================================================
Add some extra modes that fit the system:
BOW PVP
BED PVP
POTION PVP
UHC PVP
SUMO
CLASSIC PVP
NETHERITE PVP
SHIELD PVP
POTION SWORD
Make them configurable.
If a mode is disabled in config:
enabled: false
it should disappear from the GUI.
==================================================
25. KIT SYSTEM
==================================================
Create a centralized KitManager.
Each kit should be configurable.
Example:
kits:
sword:
enabled: true
weapon:
material: NETHERITE_SWORD
enchantments:
sharpness: 5
unbreaking: 3
axe:
arrows: 8
Do not hard-code everything into Java.
Make kits easy to modify.
==================================================
26. CUSTOM KIT INVENTORY
==================================================
Add:
MY KIT
Players can customize certain allowed inventory slots from the GUI.
They can choose which allowed items appear in their hotbar.
Example:
Hotbar slot 1:
Sword
Hotbar slot 2:
Golden Apple
Hotbar slot 3:
Pearl
etc.
The player can:
- move allowed items
- swap allowed items
- save layout
- reset layout
The saved layout belongs to the player's UUID.
Save permanently.
==================================================
27. KIT GUI SECURITY
==================================================
This is extremely important.
Players MUST NOT be able to:
- take unauthorized items
- duplicate items
- remove items
- drop GUI items
- shift-click items
- drag items outside the GUI
- move items into protected slots
- exploit the inventory
Only allowed configuration slots can be changed.
Everything else is locked.
==================================================
28. PARTY SYSTEM
==================================================
Players can create parties through the GUI.
Maximum:
8 players.
Party GUI:
CREATE PARTY
INVITE PLAYER
PARTY MEMBERS
KICK PLAYER
LEAVE PARTY
DISBAND PARTY
START DUEL
Party leader:
- invite
- kick
- choose duel mode
- start queue
Members:
- accept invitation
- leave party
==================================================
29. PARTY INVITES
==================================================
Create GUI for inviting players.
Show online players.
Invite expiration:
30 seconds
Configurable.
Example:
"✦ BLHEROx invited you to a party."
Buttons:
ACCEPT
DECLINE
If invitation expires:
"Party invitation expired."
==================================================
30. PARTY KICK
==================================================
Leader can select a member and:
KICK
Show confirmation:
"Are you sure?"
YES
NO
==================================================
31. PARTY SIZE
==================================================
Maximum:
8
Do not allow:
9th player.
Show:
"✖ Party is full."
==================================================
32. PARTY DUELS
==================================================
A party can select:
TEAM DUEL
Then choose:
PvP type.
Example:
Party of 7:
randomly distribute:
RED = 3
BLUE = 4
Party of 8:
RED = 4
BLUE = 4
Do not force an uneven distribution when an even distribution is possible.
==================================================
33. DUEL STATE SYSTEM
==================================================
Every player can have exactly one state:
IDLE
IN_QUEUE
PARTY
IN_MATCH
SPECTATING
Prevent state conflicts.
Example:
A player cannot:
queue while already in a duel.
A player cannot:
join a party duel while already in another queue.
A player cannot:
accept a duel invitation while in a match.
==================================================
34. 3+ PLAYER DUELS
==================================================
Support:
1v1
2v2
3v3
4v4
Also allow custom party sizes up to 8.
If there are 3 players in a free-for-all style match:
Everyone fights.
If one player dies:
They become spectator.
The match continues.
When only ONE player remains:
That player wins.
IMPORTANT:
Only ONE winner is declared.
==================================================
35. SPECTATOR SYSTEM
==================================================
When a player dies during a multi-player duel:
Do NOT kick them immediately.
Set them to spectator.
Teleport them safely to the arena spectator location.
Prevent:
damage
item pickup
item dropping
interacting with arena
breaking blocks
placing blocks
interfering with remaining players
They can watch the match.
Show:
"SPECTATING"
==================================================
36. TEAM DEATH
==================================================
For team duels:
If a player dies:
They become spectator.
Their team can continue fighting.
When every member of a team has died:
That team loses.
Other team wins.
For example:
RED:
A
B
C
BLUE:
D
E
F
If A/B/C die:
RED TEAM LOST
D/E/F:
BLUE TEAM WINS
==================================================
37. LEAVING A DUEL
==================================================
Players MUST be able to leave a duel.
Allow:
GUI button
ESC/back where appropriate
configured leave mechanism
If a player leaves:
Treat it as a loss/forfeit.
The opponent/team wins.
Show:
"PLAYER LEFT THE DUEL"
Do not let leaving create a duplicate reward or duplicate winner.
==================================================
38. INVENTORY SAFETY
==================================================
THIS IS CRITICAL.
Before entering a duel:
Save the player's complete state:
inventory
armor
offhand
XP
level
food
health
gamemode
location
effects if necessary
Then clear their inventory and give the duel kit.
When duel ends:
Restore the exact previous state.
Do NOT lose player items.
Do NOT duplicate player items.
Do NOT overwrite items.
If a player disconnects during a duel:
Save their state safely.
When they return:
restore their normal inventory/state appropriately.
==================================================
39. DUEL WORLD CLEANUP
==================================================
When a player leaves/finishes the duel:
Remove all temporary duel items.
Clear duel inventory.
Restore original inventory.
Do NOT blindly clear inventories in normal worlds.
Inventory clearing/restoration must only happen as part of the duel state lifecycle.
==================================================
40. ITEM DROP PROTECTION
==================================================
During duel kit mode:
Prevent players from dropping protected kit items if configured.
For GUI:
Players cannot drop GUI items.
For kit:
Allow item behavior only if the mode permits it.
==================================================
41. BLOCK PROTECTION
==================================================
Every PvP mode can configure:
block-break
block-place
explosions
fire
water
lava
Example:
crystal:
block-place: true
sword:
block-place: false
==================================================
42. ARENA RESET
==================================================
For modes that modify blocks:
Crystal
Anchor
TNT
TNT Minecart
provide arena reset support.
Possible approaches:
- schematic backup
- world clone
- region snapshot
- configured reset system
The implementation must be safe and not lag the server unnecessarily.
Never reset an entire world synchronously if it causes major lag.
==================================================
43. MATCH START
==================================================
When players arrive:
Give them their kits.
Teleport them to their spawn.
Freeze them temporarily.
Show countdown:
5
4
3
2
1
FIGHT!
==================================================
44. 5 SECOND PROTECTION
==================================================
At match start:
5-second protection.
During protection:
Players cannot damage each other.
Show:
"⚔ PREPARE!"
Then:
"5"
"4"
"3"
"2"
"1"
Then:
"FIGHT!"
Remove protection.
==================================================
45. MATCH FOUND TITLE
==================================================
When match is found:
Title:
"MATCH FOUND!"
Subtitle:
"Crystal PvP"
==================================================
46. WIN TITLE
==================================================
Winner:
Title:
"VICTORY!"
Subtitle:
"You won the duel!"
==================================================
47. LOSS TITLE
==================================================
Loser:
Title:
"DEFEAT"
Subtitle:
"You lost the duel."
==================================================
48. TEAM WIN
==================================================
Winning team:
Title:
"TEAM VICTORY!"
Subtitle:
"RED TEAM WINS!"
Losing team:
Title:
"TEAM DEFEAT"
Subtitle:
"BLUE TEAM WINS!"
Use the actual team dynamically.
==================================================
49. PLAYER DEATH
==================================================
When player dies:
Title:
"ELIMINATED"
Subtitle:
"You are now spectating."
For a normal 1v1:
End the match immediately.
For multi-player:
Convert them to spectator.
==================================================
50. MATCH END
==================================================
After the winner is determined:
Stop all duel tasks.
Stop all effects.
Remove combat state.
Restore inventories.
Restore player states.
Return players to configured lobby/spawn location.
Free the arena.
Remove them from queue.
Remove them from match.
Do not leave ghost states.
==================================================
51. MATCH TIMER
==================================================
Add configurable match timeout.
Example:
match-settings:
max-duration-seconds: 600
If time expires:
Use configurable behavior:
- sudden death
- highest health
- draw
- random winner
Default:
draw
==================================================
52. COMBAT LOGGING
==================================================
If a player disconnects during combat:
Treat it as leaving/forfeit.
Opponent wins.
If the server crashes:
Store enough match state to safely restore players after restart if possible.
Never permanently delete player inventory because of a crash.
==================================================
53. RECONNECT SAFETY
==================================================
If player disconnects:
Store:
UUID
match
arena
team
inventory snapshot
state
When they reconnect:
Safely restore them.
If the match already ended:
restore normal state and send them to lobby.
==================================================
54. SCOREBOARD
==================================================
While in duel:
Display:
✦ MYTHRION DUELS
Mode:
Crystal PvP
Opponent:
PLAYER
Arena:
Crystal-01
Time:
01:24
Status:
FIGHTING
For team:
Team:
RED
Alive:
3 / 4
Enemy:
2 / 4
==================================================
55. ACTION BAR
==================================================
During countdown:
"⚔ Match starting in 3..."
During combat:
"❤ 18.5 HP"
For spectators:
"👁 SPECTATING"
==================================================
56. SOUND EFFECTS
==================================================
Add configurable sounds.
Match found:
sound
Countdown:
sound
Fight:
sound
Victory:
sound
Defeat:
sound
Elimination:
sound
Allow:
sounds:
enabled: true
volume: 0.7
==================================================
57. STATISTICS
==================================================
Track:
matches played
wins
losses
kills
deaths
win streak
highest win streak
favorite mode
Save by UUID.
==================================================
58. STATS GUI
==================================================
Add:
MY STATS
Display:
Matches:
125
Wins:
87
Losses:
38
Kills:
210
Deaths:
104
Win Streak:
7
Favorite:
Sword PvP
==================================================
59. LEADERBOARD
==================================================
Add leaderboard GUI.
Categories:
Most Wins
Most Kills
Highest Win Streak
Most Played
Make it configurable.
Use UUID-based data.
Do not make leaderboard queries expensive.
==================================================
60. PERMISSIONS
==================================================
Base:
mythrionduels.use
Duel permissions:
mythrionduels.duel.spear_elytra
mythrionduels.duel.mace_elytra
mythrionduels.duel.spear_mace
mythrionduels.duel.sword
mythrionduels.duel.sword_op
mythrionduels.duel.crystal
mythrionduels.duel.anchor
mythrionduels.duel.axe
mythrionduels.duel.tnt
mythrionduels.duel.fist
Team:
mythrionduels.team
Party:
mythrionduels.party
Stats:
mythrionduels.stats
Admin:
mythrionduels.admin
Wildcard:
mythrionduels.*
OP should have access by default where appropriate.
Must work with LuckPerms.
==================================================
61. CONFIGURATION
==================================================
Create an extremely clean config.yml.
I want to be able to easily see:
world names
spawn locations
kits
enchantments
permissions
queue settings
party settings
match settings
countdown
sounds
GUI titles
messages
arena settings
Example:
settings:
max-party-size: 8
max-team-size: 4
max-match-duration: 600
match:
countdown: 5
starting-protection: 5
worlds:
sword:
world: duel_sword
spawn1:
x: 0
y: 70
z: 50
yaw: 180
pitch: 0
spawn2:
x: 0
y: 70
z: -50
yaw: 0
pitch: 0
crystal:
world: duel_crystal
anchor:
world: duel_anchor
axe:
world: duel_axe
fist:
world: duel_fist
tnt:
world: duel_tnt
==================================================
62. GUI CONFIGURATION
==================================================
Allow GUI titles to be changed from config.
Example:
gui:
main-title: "✦ MYTHRION DUELS ✦"
solo-title: "⚔ SOLO DUELS"
team-title: "⚔ TEAM DUELS"
party-title: "✦ PARTY"
queue-title: "⌛ QUEUE"
==================================================
63. MESSAGES
==================================================
All messages configurable.
IMPORTANT:
NEVER send raw:
&6
&a
&b
&c
&d
&e
&f
to players.
Use Adventure Components correctly.
No raw color codes should ever appear in chat.
==================================================
64. ANTI-EXPLOIT
==================================================
Prevent:
item duplication
inventory duplication
death duplication
kit duplication
double rewards
double winner
double arena reset
queue duplication
party duplication
multiple matches for same player
spectator item pickup
spectator damage
GUI item theft
shift-click exploits
drag exploits
drop exploits
Use proper state locking.
==================================================
65. PERFORMANCE
==================================================
This plugin will run on a real server with many players.
Optimize heavily.
Do NOT:
scan every player every tick
run unnecessary global repeating tasks
write player data every tick
perform synchronous heavy disk I/O during combat
clone huge worlds synchronously
spam packets
spawn unnecessary particles
create unlimited match objects
Use event-driven logic wherever possible.
Use asynchronous operations only for operations that are safe to perform asynchronously.
Never access Bukkit world/entity APIs from an unsafe async thread.
==================================================
66. FOLIA SUPPORT
==================================================
This must be REAL Folia support.
Do not simply put:
folia-supported: true
and consider it finished.
Use appropriate Folia schedulers.
Avoid unsafe BukkitScheduler usage.
Player/entity operations must happen on the appropriate scheduler.
==================================================
67. OPTIONAL INTEGRATIONS
==================================================
ViaVersion:
optional
ViaBackwards:
optional
Geyser:
optional
Floodgate:
optional
LuckPerms:
optional
If any are missing:
PLUGIN MUST STILL START.
==================================================
68. PLUGIN STARTUP
==================================================
Console should show something professional:
[MythrionDuels] Loading MythrionDuels...
[MythrionDuels] Loaded X duel modes.
[MythrionDuels] Loaded X arenas.
[MythrionDuels] Party system enabled.
[MythrionDuels] Queue system enabled.
[MythrionDuels] MythrionDuels enabled successfully.
Do not spam console.
==================================================
69. DATA FILES
==================================================
Use:
plugins/MythrionDuels/
config.yml
players.yml or players/
arenas.yml if needed
stats.yml
parties.yml if needed
Prefer UUID-based storage.
Do not save data every tick.
==================================================
70. SAFE SERVER RESTART
==================================================
On shutdown:
Safely handle active matches.
Restore players where possible.
Save important state.
Do not leave players permanently locked in:
IN_MATCH
SPECTATING
IN_QUEUE
==================================================
71. GUI DESIGN
==================================================
Make the GUI look like a premium PvP network.
Use:
dark glass panes
gold/white/red/blue accents
clear icons
short lore
selected indicators
locked indicators
queue indicators
Example effect:
⚔ Sword PvP
"Classic sword combat"
✔ Available
Example locked:
🔒 Crystal PvP
"Requires permission"
==================================================
72. QUEUE STATUS
==================================================
Show live queue information.
Example:
Sword PvP
Searching...
Players waiting:
5
Your position:
2
Button:
✖ Leave Queue
==================================================
73. ARENA STATUS
==================================================
If useful, show:
Available arenas:
3
Active matches:
12
Do not expose unnecessary technical information.
==================================================
74. DUEL INVITATIONS
==================================================
Although the primary system is queue-based, also support direct duel invitations through the GUI.
Player selects another player.
Select:
PvP mode.
Send invitation.
The invited player gets:
DUEL REQUEST
[Sword PvP]
ACCEPT
DECLINE
Expiration configurable.
==================================================
75. PARTY + QUEUE
==================================================
Party leader can select:
Team Duel
Then:
PvP mode
Then:
QUEUE
The entire party enters the queue together.
If party has 7 players:
3v4
If party has 8:
4v4
The party must stay together until match starts.
==================================================
76. RANDOM TEAM SELECTION
==================================================
When team match starts:
Shuffle players securely.
Split into balanced teams.
Do not always assign based on party order.
Show:
"Teams have been randomly selected!"
Then display:
RED TEAM
Player1
Player2
Player3
BLUE TEAM
Player4
Player5
Player6
==================================================
77. MATCHMAKING
==================================================
Queue matching must be thread-safe.
Never create:
two matches from the same queue members.
When a match is created:
remove all matched players from the queue atomically.
==================================================
78. PLAYER WORLD HANDLING
==================================================
When entering a duel:
save original world/location.
Teleport to configured duel world.
When finished:
return player to saved location if safe.
Otherwise use configured lobby spawn.
==================================================
79. WORLD CHANGE PROTECTION
==================================================
If a player attempts to leave a duel world during a match:
Prevent unsafe teleport if appropriate.
If they intentionally leave:
treat as forfeit.
Do not allow them to escape the match and keep the kit.
==================================================
80. DEATH HANDLING
==================================================
Handle death carefully.
Prevent normal death item drops from causing duplication.
Clear temporary duel items after death.
For multi-player:
spectator.
For final player:
winner.
==================================================
81. RESPAWN
==================================================
Do not let the player respawn into an unsafe normal-world location with duel state still active.
Handle respawn safely.
==================================================
82. KIT ENCHANTMENTS
==================================================
All enchantments must be configurable.
Do not hard-code incompatible enchantment combinations.
Use the correct modern Paper/Minecraft API for enchantments.
==================================================
83. HOTBAR SAVES
==================================================
Player's custom hotbar layout must be saved by UUID.
Example:
player:
UUID:
layouts:
sword:
slot1: sword
slot2: golden_apple
slot3: pearl
Each PvP mode can have its own saved layout.
==================================================
84. DEFAULT KITS
==================================================
If player never customized:
Use default configured kit layout.
If they customized:
Use their saved layout.
Never allow them to remove mandatory equipment if the mode requires it.
Example:
Sword PvP always requires sword.
Crystal PvP always requires required crystal/obsidian resources.
==================================================
85. ADMIN CONFIGURATION
==================================================
Do NOT create admin commands unless absolutely necessary.
Prefer config.yml for setup.
The plugin should be easy to configure manually.
==================================================
86. ERROR RECOVERY
==================================================
If:
world doesn't exist
spawn invalid
kit invalid
material invalid
enchantment invalid
player disconnects
arena unavailable
configuration malformed
DO NOT CRASH.
Log a clear error.
Safely cancel the affected match/queue.
Restore player state.
==================================================
87. BUILD REQUIREMENTS
==================================================
Use:
Java 25
Gradle or Maven
Build against REAL Paper 26.2.
Run:
clean build
Then:
- inspect JAR
- verify plugin.yml
- verify config.yml
- verify main class
- verify command
- verify dependencies
- verify no fake Bukkit classes
- verify JAR integrity
==================================================
88. AUTOMATED TESTING
==================================================
Before giving me the JAR, test as much as possible:
/duels
Main GUI
Solo GUI
Team GUI
Random GUI
Party GUI
Queue GUI
Stats GUI
Kit editor
Sword queue
Crystal queue
Axe queue
Fist queue
Team queue
Party of 2
Party of 4
Party of 7
Party of 8
Party full
Party invite
Party accept
Party decline
Party kick
Party leave
Queue leave
Match found
Teleport
Countdown
5 second protection
Fight
Death
Spectator
Winner
Loser
Team victory
Team defeat
Player leaving
Player disconnecting
Inventory restore
World restore
Arena release
Multiple simultaneous arenas
Permission denied
Permission granted
GUI locked item
GUI drag
GUI shift-click
GUI item drop
Reconnect
Server shutdown handling
==================================================
89. FINAL BUILD REQUIREMENT
==================================================
DO NOT say:
"The JAR should be in build/libs."
Actually verify it.
DO NOT give me a fake or empty JAR.
DO NOT give me source code instead.
DO NOT stop because one compilation error appears.
If build fails:
1. Read error.
2. Fix code.
3. Build again.
4. Repeat.
Only finish when the build succeeds.
==================================================
90. FINAL FILE
==================================================
The final file MUST be:
mythrionduels.jar
It must be a real compiled Minecraft plugin.
Give me a direct download link to the actual file.
==================================================
FINAL GOAL
==================================================
I want MythrionDuels to feel like a professional competitive Minecraft PvP network plugin.
It should be:
FAST
CLEAN
SMART
SECURE
LIGHTWEIGHT
EASY TO CONFIGURE
FOLIA SAFE
PAPER COMPATIBLE
GUI BASED
QUEUE BASED
PARTY BASED
TEAM BASED
ANTI-DUPLICATION
INVENTORY SAFE
ARENA SAFE
The GUI should be beautiful.
The matchmaking should be reliable.
The inventory system must NEVER lose player items.
The plugin must never allow players to exploit kits or GUI inventories.
The system must be designed for many simultaneous matches.
PLUGIN:
MythrionDuels
COMMAND:
/duels
JAR:
mythrionduels.jar
Project foundation: Gradle build, plugin metadata, Folia-safe scheduler, and configuration.
Core duel systems: modes, kits, arenas, player state, queues, parties, matches, snapshots, and statistics.
GUI and events:
/duels, secure menus/kit editor, protection handlers, countdowns, spectators, restoration, and shutdown recovery.
Created the MythrionDuels Gradle project with:
/duelsGUI commandSolo/team/random queue menus
Party creation, invites, team queue flow
Configurable duel modes, kits, worlds, arenas, and permissions
Inventory snapshots and restoration
Match countdown, protection, spectators, victory/defeat handling
Statistics and persistent player layouts
Folia-compatible Paper schedulers
plugin.yml,config.yml,manifest.kod, and Java 25 Gradle configuration
I cannot honestly provide a verified mythrionduels.jar download from this session because build/test execution was unavailable and the requested Paper 26.2 API coordinate is not a published dependency I can target reliably. The project currently targets the available Paper 1.21.8 API while compiling for Java 25.
package com.mythrion.duels;
import com.mythrion.duels.command.DuelsCommand;
import com.mythrion.duels.core.ModeDefinition;
import com.mythrion.duels.core.PlayerState;
import com.mythrion.duels.core.SchedulerAdapter;
import com.mythrion.duels.data.PlayerDataStore;
import com.mythrion.duels.data.StatsStore;
import com.mythrion.duels.gui.ItemUtil;
import com.mythrion.duels.gui.MenuManager;
import com.mythrion.duels.kit.KitManager;
import com.mythrion.duels.listener.DuelListener;
import com.mythrion.duels.match.ArenaManager;
import com.mythrion.duels.match.MatchManager;
import com.mythrion.duels.party.PartyManager;
import com.mythrion.duels.queue.QueueManager;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
public class MythrionDuelsPlugin extends JavaPlugin {
private final Map<UUID, PlayerState> states = new java.util.concurrent.ConcurrentHashMap<>();
private final Map<String, ModeDefinition> modes = new LinkedHashMap<>();
private SchedulerAdapter scheduler;
private KitManager kits;
private PlayerDataStore players;
private StatsStore stats;
private QueueManager queues;
private PartyManager parties;
private MatchManager matches;
private MenuManager menus;
private Messages messages;
@Override
public void onEnable() {
saveDefaultConfig();
messages = new Messages(this);
scheduler = new SchedulerAdapter(this);
loadModes();
kits = new KitManager(this);
players = new PlayerDataStore(this);
stats = new StatsStore(this);
parties = new PartyManager(this);
queues = new QueueManager(this);
ArenaManager arenas = new ArenaManager(this);
matches = new MatchManager(this, scheduler, arenas);
menus = new MenuManager(this);
Bukkit.getPluginManager().registerEvents(new DuelListener(this), this);
getCommand("duels").setExecutor(new DuelsCommand(this));
getLogger().info("Loading MythrionDuels...");
getLogger().info("Loaded " + modes.size() + " duel modes and " + arenas.count() + " arenas.");
getLogger().info("Party system enabled.");
getLogger().info("Queue system enabled.");
getLogger().info("MythrionDuels enabled successfully.");
}
@Override
public void onDisable() {
if (matches != null) matches.shutdown();
if (queues != null) queues.leaveAll();
if (players != null) players.save();
if (stats != null) stats.save();
}
private void loadModes() {
var section = getConfig().getConfigurationSection("modes");
if (section == null) return;
for (String id : section.getKeys(false)) {
var mode = section.getConfigurationSection(id);
if (mode == null || !mode.getBoolean("enabled", true)) continue;
modes.put(id, new ModeDefinition(id, mode.getString("name", id), mode.getString("icon", "PAPER"), mode.getString("kit", id), mode.getString("world", id), mode.getBoolean("team", true), mode.getBoolean("block-place"), mode.getBoolean("block-break"), mode.getBoolean("explosions")));
}
}
public boolean canUse(Player player, ModeDefinition mode) {
return player.hasPermission("mythrionduels.duel." + mode.getId()) || player.hasPermission("mythrionduels.*");
}
public Map<UUID, PlayerState> states() { return states; }
public Map<String, ModeDefinition> modes() { return modes; }
public SchedulerAdapter scheduler() { return scheduler; }
public KitManager kits() { return kits; }
public PlayerDataStore players() { return players; }
public StatsStore stats() { return stats; }
public QueueManager queues() { return queues; }
public PartyManager parties() { return parties; }
public MatchManager matches() { return matches; }
public MenuManager menus() { return menus; }
public Messages messages() { return messages; }
public static class Messages {
private final MythrionDuelsPlugin plugin;
public Messages(MythrionDuelsPlugin plugin) { this.plugin = plugin; }
public Component rawTitle(String path) { return ItemUtil.text(plugin.getConfig().getString(path, "Mythrion Duels")); }
public void send(Player player, String key, Map<String, String> values) {
player.sendMessage(ItemUtil.text(format(key, values)));
}
public void send(UUID uuid, String key, Map<String, String> values) {
Player player = Bukkit.getPlayer(uuid);
if (player != null) send(player, key, values);
}
public void broadcast(Iterable<UUID> players, String key, Map<String, String> values) {
for (UUID uuid : players) send(uuid, key, values);
}
public void title(Player player, String title, String subtitle, int fadeIn, int stay, int fadeOut) {
player.showTitle(net.kyori.adventure.title.Title.title(ItemUtil.text(title), ItemUtil.text(subtitle), net.kyori.adventure.title.Title.Times.times(java.time.Duration.ofMillis(fadeIn * 50L), java.time.Duration.ofMillis(stay * 50L), java.time.Duration.ofMillis(fadeOut * 50L))));
}
public void actionBar(Player player, String text) { player.sendActionBar(ItemUtil.text(text)); }
private String format(String key, Map<String, String> values) {
String text = plugin.getConfig().getString("messages." + key, key);
for (Map.Entry<String, String> entry : values.entrySet()) text = text.replace("{" + entry.getKey() + "}", entry.getValue());
return text;
}
}
}