Create a production-ready SkyPvP plugin for a Paper 1.8.x (1.8.8-compatible) Minecraft server that runs the entire SkyPvP mode inside one specific configured world (NOT a separate server). The mode must behave like a dedicated SkyPvP server while sharing the same JVM/server with other worlds/modes. The plugin must be high performance, event-driven, thread-safe, and use async MySQL for all persistent data (never block the main thread). Everything must be configurable via YAML and all messages must be customizable.
Target Platform
Server: Paper 1.8.x (assume 1.8.8 NMS compatibility)
API: Bukkit/Spigot/Paper 1.8
Java: Compatible with Java 8 baseline (safe for 1.8 server ecosystems)
Must avoid heavy allocations, avoid memory leaks, and be stable for long uptime.
Core Mode Rules
SkyPvP is confined to one world only, defined in config.yml (e.g., skypvp-world: "SkyPvP").
Plugin features only apply inside that world, except /skypvp join which can be executed anywhere (teleports into SkyPvP).
Broadcasts related to killstreaks must broadcast to SkyPvP world only (not global server).
Data & Storage Requirements (MySQL + Async)
Persist ALL of the following to MySQL:
Player “mode initialization” flag (first time join tracking)
SkyPvP inventory snapshot:
Inventory contents
Armor contents
Active potion effects
Exact SkyPvP last location:
world name (SkyPvP world)
x, y, z, yaw, pitch
Statistics:
kills, deaths
current killstreak, highest killstreak
prestige level
K/D ratio computed dynamically (store kills/deaths, compute ratio on read)
Mode economy (coins balance)
Performance / Concurrency Rules
Use a connection pool (HikariCP recommended).
All SQL operations must be executed asynchronously (Bukkit async scheduler or your own executor).
Never access Bukkit API from async threads except for safe immutable data; all player/world/inventory operations must occur on the main thread.
Implement a Storage abstraction layer:
Storage interface (methods for save/load stats, economy, player snapshot, initialized flag)
MySqlStorage implementation
Implement a Repository/DAO style with prepared statements and batched writes when possible.
Implement safe caching where beneficial (e.g., in-memory session cache while player is in SkyPvP) but avoid stale data and memory leaks:
Use ConcurrentHashMap for online SkyPvP participants
Remove session on leave/kick/quit
Ensure server shutdown persists data for all online SkyPvP players (onDisable flush with timeout, best-effort).
YAML Configuration Files
config.yml
world name
spawn location
lobby location
gamemode after respawn (SURVIVAL or ADVENTURE)
spectator seconds
combat time seconds
post-kill combat extra time (10 seconds fixed but keep configurable too)
custom void Y-level
MySQL credentials + pool settings
messages.yml
Every message in the plugin including command help text
Placeholders support (at minimum internal placeholders; optionally PlaceholderAPI hook if present)
killstreaks.yml
Milestones keyed by kill count (e.g., 5, 10, 15)
Each milestone supports:
message to player
broadcast to SkyPvP world only
titles (1.8 compatible title API)
coin rewards
console commands list (with placeholder replacement)
prestige.yml
Prestige thresholds (kills required per prestige level or list of thresholds)
Prestige-up message template(s)
Commands, Permissions, and Behavior
Root Command: /skypvp
Subcommands:
/skypvp join
/skypvp leave
/skypvp setlobby (admin)
/skypvp setspawn (admin) (required even if not explicitly requested; needed for spawn)
/skypvp setkit (admin)
/skypvp coins
/skypvp pay
/skypvp coins add (admin)
/skypvp coins set (admin)
/skypvp coins remove (admin)
Optional but recommended: /skypvp stats (player view stats) for verifying system
Permissions:
skypvp.use (join/leave/coins/pay/stats)
skypvp.admin (setkit/setspawn/setlobby/coins admin)
Ensure help output in messages.yml and respects permissions.
1) /skypvp join (Strict Logic)
When player runs /skypvp join:
IF FIRST TIME (not initialized in DB):
Teleport to configured SkyPvP spawn.
Give default kit (from kit system).
Mark initialized=true in DB (async write).
Set their “SkyPvP session” active in memory.
IF NOT FIRST TIME:
Load SkyPvP snapshot from DB (async load).
On main thread:
Restore inventory + armor
Restore active potion effects
Teleport to last saved SkyPvP location (x,y,z,yaw,pitch)
Set their “SkyPvP session” active in memory.
Must store/restore:
Inventory + armor
Potion effects
Exact location (including yaw/pitch)
Saving Conditions (Must Always Save on These)
The plugin must persist a SkyPvP player snapshot (inventory, armor, effects, last location) to MySQL when:
Player executes /skypvp leave
Player disconnects (quit)
Player is kicked
Server shuts down / plugin disables
Implementation details:
Use listeners: PlayerQuitEvent, PlayerKickEvent
Also handle world change if you allow leaving via other means: if player teleports out of SkyPvP world without /skypvp leave, you must still save snapshot and end session (configurable: either prevent leaving or auto-save & treat as leave).
Ensure the final location saved is the player’s actual SkyPvP world position at the time of leaving.
2) Statistics System (MySQL)
Track per-player:
kills
deaths
K/D ratio (computed automatically, avoid division by zero)
current killstreak
highest killstreak
total prestige level
Rules:
Update stats reliably on every kill/death/void death.
Must never “miss” kill awards due to timing or combat edge cases.
3) Combat System (CRITICAL, Must Be Reliable)
When Player A damages Player B (in SkyPvP world only):
Both enter combat.
Start/refresh a combat timer for both (configurable duration).
Store “last attacker” mapping for B (UUID of attacker, and timestamp).
While in combat:
/skypvp leave is blocked and sends configurable message.
If they disconnect, apply combat log penalty (configurable actions):
Count as death
Award kill to last attacker (if valid)
Optionally drop inventory (but for this plugin, follow your death rules; ensure kit items handling remains correct)
Reset killstreak
On kill:
Victim receives configurable message:
"You were killed by who had hearts remaining."
Killer receives configurable message:
"You killed and you have hearts remaining."
After kill:
Killer remains in combat for 10 seconds (configurable but default 10)
Victim leaves combat instantly
Victim receives:
"You are no longer in combat. You may logout" (configurable)
Combat must be implemented with a CombatManager that:
Tracks combat end timestamps per player
Provides isInCombat(UUID) and getRemainingSeconds(UUID)
Handles scheduling a lightweight repeating task or per-player delayed tasks without task spam
Use safe checks to avoid memory leaks (remove on quit/leave).
4) Void System (Configurable Height)
Config: custom-void-y:
When player’s Y position drops below this level (SkyPvP world only):
If NOT in combat:
Count as death only (no special message)
Trigger respawn sequence
If IN combat:
Award kill to last attacker (must be valid within combat rules)
Trigger respawn sequence
Implementation:
Use a lightweight repeating task that checks only players currently in SkyPvP world (or only session players) every few ticks, OR use PlayerMoveEvent with careful optimization (avoid heavy logic per move). Prefer scheduled check to reduce event spam.
5) Respawn Sequence (STRICT ORDER, Must Always Execute)
The respawn logic must always execute in this exact order:
Player dies.
Set gamemode to SPECTATOR.
Clear inventory and potion effects.
Allow flying around death area (do NOT teleport immediately).
Wait configurable seconds (spectator-seconds).
Teleport to SkyPvP spawn.
Set gamemode to SURVIVAL or ADVENTURE (configurable).
Give default kit.
Reset killstreak counter.
Requirements:
Works for normal deaths and void deaths.
Must not break if the player respawns automatically; you must control the process via events:
Listen to PlayerDeathEvent and PlayerRespawnEvent
Suppress default death messages (and ensure console doesn’t log them)
Ensure the player is placed into spectator without teleporting immediately
Ensure that “clear inventory” happens after death but before kit re-give.
Kit is given only after step 7 completes.
6) Prestige System (Automatic)
Configurable kill thresholds (prestige.yml).
When a player reaches the configured threshold:
Automatically increase prestige level
Send configurable prestige message
Persist prestige in DB async
No commands needed.
Decide how thresholds work:
Option A: kills required per prestige level (list/map)
Option B: formula-based (base + increment)
Implement the config as a list/map and document it.
7) Killstreak System
Milestones configured in killstreaks.yml (e.g., 5, 10, 15…).
At each milestone:
Send custom message to player
Broadcast custom message to SkyPvP world only
Optionally execute console commands
Optionally give coins
Optionally send titles/messages
All fully configurable, with placeholders like:
{player}, {kills}, {killstreak}, {prestige}, {coins}
8) Kit System (NBT Tagging + No Drops)
Default kit rules:
Given only:
On first /skypvp join
After respawn sequence completes
Default kit items cannot be dropped.
Identify kit items using NBT tags (1.8 NMS/CraftItemStack):
Add a boolean tag like skypvp_kit=true
On item drop, cancel if tagged
Also prevent moving kit items into certain exploits if desired (optional): e.g., prevent dropping via inventory click outside
Admin command:
/skypvp setkit
Saves the executing admin’s current inventory + armor as the default kit (to kit.yml or within config)
Must serialize items safely to YAML (base64 ItemStack serialization recommended)
Preserve enchantments, names, lore, etc.
9) Mode-Specific Economy (Coins)
Coins are separate for SkyPvP only.
Commands:
/skypvp coins (view own coins)
/skypvp pay (transfer coins, must validate)
Admin:
/skypvp coins add
/skypvp coins set
/skypvp coins remove
Rules:
All updates stored in MySQL async
Use atomic operations to avoid race conditions (transaction or single UPDATE with checks)
Validate non-negative balances and amounts
10) Lobby & Leave System
Admin:
/skypvp setlobby sets the lobby return location (any world)
Player:
/skypvp leave
Only allowed if not in combat
Teleport to lobby
Save SkyPvP snapshot (inventory, armor, effects, location) before leaving (location is last SkyPvP location)
End SkyPvP session in memory
Also ensure /skypvp join can be used from lobby/anywhere.
Message Handling (Must Be Fully Configurable)
Every user-facing string must come from messages.yml (including help, errors, join/leave, combat messages, cooldowns, prestige, coins).
Support color codes &.
Provide a MessageManager with placeholder replacement.
Optionally integrate PlaceholderAPI if present, but must work without it.
Production Plugin Structure (Must Output Full Class Organization)
Generate a complete project layout with packages like:
com.yourname.skypvp.SkyPvPPlugin (main)
com.yourname.skypvp.config
ConfigManager (loads config.yml/messages.yml/killstreaks.yml/prestige.yml/kit.yml)
com.yourname.skypvp.command
SkyPvPCommand (subcommand router)
Subcommand classes: JoinCommand, LeaveCommand, SetKitCommand, SetSpawnCommand, SetLobbyCommand, CoinsCommand, PayCommand, StatsCommand
com.yourname.skypvp.listener
CombatListener (EntityDamageByEntityEvent, etc.)
DeathListener (PlayerDeathEvent, PlayerRespawnEvent)
QuitKickListener (PlayerQuitEvent, PlayerKickEvent)
WorldListener (prevent unwanted behavior outside world)
ItemProtectionListener (PlayerDropItemEvent, InventoryClickEvent as needed)
com.yourname.skypvp.manager
ModeManager (session tracking, join/leave orchestration)
CombatManager
StatsManager
EconomyManager
PrestigeManager
KillstreakManager
KitManager
VoidManager (task-based Y-check)
RespawnManager (strict ordered sequence control)
com.yourname.skypvp.storage
Storage interface
MySqlStorage (HikariCP)
SqlSchema / migrations helper (create tables on startup)
com.yourname.skypvp.model
PlayerSnapshot (inv/armor/effects/location)
PlayerStats
PlayerEconomy
PlayerSession (in-memory state: inMode, inCombat, lastAttacker, etc.)
com.yourname.skypvp.util
ItemSerializer (base64)
LocationUtil
NbtUtil (1.8 NMS tagging)
TaskUtil (main-thread callbacks from async)
Include plugin.yml with commands and permissions.
Database Schema (Must Provide)
Provide table designs (with indexes):
skypvp_players (uuid PK, initialized, last_world, x,y,z,yaw,pitch, inventory_blob, armor_blob, effects_blob, last_updated)
skypvp_stats (uuid PK, kills, deaths, current_killstreak, highest_killstreak, prestige)
skypvp_economy (uuid PK, coins)
Use appropriate data types (e.g., BINARY(16) for UUID optimized if implementing, or CHAR(36) if keeping simple; but be consistent).
Add indexes where needed.
Critical Edge Cases to Handle
Player dies while in combat → ensure correct kill attribution.
Void death while in combat → award kill to last attacker reliably.
Combat timeout: attacker mapping expires with timer.
Player logs out while in combat → penalty applies and awards kill if valid.
Prevent /skypvp leave in combat always.
Ensure kit items are removed on death before respawn kit (strict sequence).
Ensure no death messages are broadcast or logged.
Ensure saving occurs on kick/quit/disable without blocking shutdown.
Ensure only SkyPvP world is affected (no cross-world interference).
Output Expectations for the Generator
Produce:
Full Java source code for all classes above (clean, commented, production style)
Full plugin.yml
Default config.yml, messages.yml, killstreaks.yml, prestige.yml, kit.yml templates
SQL table creation statements (or automatic creation in code)
Notes in code comments on thread safety (what runs async vs sync)
Make sure the final plugin is complete, compiles, and is suitable for real server use on Paper 1.8.x.