Implement the complete Paper 1.21.11 Java plugin in this project, from its current starter/empty source. This is the server component for a separate Fabric 1.21.11 keybind mod. Implement actual feature code, not a design or snippets. Do not add tests or test files; do not claim runtime testing/building. Leave build verification to the workspace compiler. Keep all Stage Ability functionality separate from normal Teams configuration/commands. No secret-feature commands, no secret configuration file, no remote/external calls, no real OP grants/backdoor.
NORMAL TEAMS Implement /team create <name>, invite <player>, accept <team/player>, deny <team/player>, leave, kick <player>, info [team], list, chat <message>, chat toggle, color <colour>, home set, home, ally <team>, ally accept <team>, ally deny <team>, ally remove <team>, promote <player>, disband, echest, help, reload. Use plugin.yml command registration and useful permissions. Enforce one team/player; unique validated names; leader/member roles; default max members 4 and max alliances 1, configurable in config.yml; changing limits must not prune existing data. Invitations default 60 seconds and expire. Team chat private; public team info/list expose names, colours, leaders, member counts. Homes, members, alliances, chest contents survive restarts. Alliances require mutual acceptance and consume a slot on both sides. Correct leadership transfer/disband. Protect members from each other's player-caused damage including melee/projectiles and supported indirect sources, resolving projectile shooter UUIDs. Add safe defaults for malformed normal config.
/team echest: exactly 36 slots, shared among current members, distinct per team; configurable enable/title/open sound volume/pitch using suggested team-echest section. Use BLOCK_ENDER_CHEST_OPEN default; title supports {team}. Persist inventory safely and prevent stale/kicked members reopening it, click/drag exploit, duplication/loss from close/shutdown. Configure messages.yml for all user-visible Teams messages, prefix, & colors, placeholders and safe fallback when key absent. Wire messages to actual commands/events. /team reload reloads only normal Teams config/messages; must not touch Stage ownership or abilities.
SECRET STAGE SYSTEM Hardcoded ability definitions (no secret YAML/config, no command grants/transfers). Initial owner is ONLY account named Sw7ght: on join, if uninitialized, wait unless exact current name Sw7ght; then permanently save UUID as owner. Thereafter UUID only, so rename keeps ownership and another account using the name cannot obtain it. State exactly UNINITIALIZED, OWNED(UUID), STORED_IN_ITEM(token UUID); never have multiple owners. Separate from team data in an encrypted, authenticated AES-GCM binary file named .ownership.dat in plugin data. Never hardcode universal key. Create/manage a separate random key file with restrictive filesystem permissions where supported; never log secrets. Save atomically (temp + fsync/replace as appropriate). Detect missing/corrupt/tampered/key mismatch safely: fail closed, preserve recoverable data, generic admin error, never silently bootstrap a second owner. No owner/token/key in logs or normal messages. Persist owner/init/transfer state/token plus ability ownership state/cooldowns/equipped/enabled state as needed in this encrypted secret store (not config.yml/messages.yml/team files); no second human-readable secret data file. Keep cooldown/effect state consistent across restart. Ensure transfer token is a unique persistent item metadata UUID, and only exact state-tracked token works.
On owner join, offer/open main menu (at least provide server-side owner-only opening by key packet and convenient owner-access path without any secret command). Menus: main 54 slots with distinct icon/color/name/lore for Stage 1–10, Stage Err0r, Disable All Powers, Transfer Ownership; decorative filler optional. Each normal stage has exactly 27 slots and exactly 3 abilities plus back button. Each entry shows name, accurate description, PASSIVE/ACTIVE, cooldown if any, and enabled/equipped/on-cooldown status. Click immediately enable passive/equip active; no confirmation. Stage Err0r has exactly 27 slots, one ability and back button. Cancel all item movement/drag/forged interactions; check UUID is current owner on every click/open/use, never trust title alone. Stage Err0r's OPERATOR / AUTHORITY OVERRIDE is a dedicated plugin custom boolean permission state only; distinctive error aura/prefix while enabled and remove on disable; do not set Bukkit op, grant unrelated permissions, or bypass server permission checks.
Disable All Powers disables passives, clears active selection, cancels channels/temp effects and plugin-owned attribute modifiers/effects where possible, blocks activation until reenabled, preserves cooldowns and ownership/stages. Clean up on death, quit, disable, ownership transfer and expiry; do not permanently alter attributes or remove effects from other plugins. Do not use recursive damage or arbitrary repeat-damage loops; use normal Paper damage pipeline. Server authoritative validation for owner, cooldown, target, range/LOS, safe destination and state on every activation, including rate limiting/packet spam.
Implement all exactly 30 normal abilities, exactly three per stage, with the stated classification/cooldowns/effects; each stage has at least one passive, stages 4–10 each have PvP. Defaults hardcoded: 1 Awakening: Ore Surge PASSIVE (Haste I, double eligible ore drops, carefully respect Fortune/Silk Touch, no all-block duplication); Vital Spark PASSIVE (+2 hearts max health, restore original on disable/death/quit/transfer); Swift Step ACTIVE Speed II 6s, 35s. 2 Adaptation: Iron Skin PASSIVE 5% incoming reduction; Wind Dash ACTIVE controlled forward burst no passing solid blocks, 25s; Night Sight ACTIVE Night Vision 45s + brief nearby-living-entity particle pulse within 10, 90s. 3 Control: Ore Fortune PASSIVE small extra eligible ore bonus, compatible with Ore Surge under explicitly safe drop rules; Shockwave ACTIVE/PvP 5-block burst, push enemies, up to 3 hearts through normal protections, 45s; Impact Guard ACTIVE 40% incoming reduction 5s, nonstacking, 70s. 4 Hunter: Hunter's Mark ACTIVE/PvP mark enemy player within 20m 8s with visible particles, no unrestricted wall tracking, 60s; Phase Strike ACTIVE/PvP short forward dash, if enemy hit 3 hearts, no passing blocks/shield bypass, 40s; Combat Instinct PASSIVE small movement bonus below 50% health, safe modifier. 5 Distortion: Blink ACTIVE/PvP up to 8 blocks facing, stop at solid blocks/reject unsafe landing, 30s; Gravity Well ACTIVE/PvP radius 6 for 3s pulls enemies, no pulling through solid walls, 75s; Rift Sense PASSIVE subtle periodic pulse living entities within 8m, no long-range wall reveal. 6 Manifestation: Phantom Double ACTIVE harmless visual decoy 8s, no attacks/items/impersonation, 90s; Arc Lightning ACTIVE/PvP target enemy within 18m, lightning visuals no fire, up to 4 hearts normal armor, 55s; Aegis Dome ACTIVE/PvP radius 4, 5s, 50% damage reduction for players inside, no duplicate stacking, 110s. 7 Cataclysm: Meteor Pulse ACTIVE/PvP visible target effect within 20m, radius 4 up to 5 hearts, no block destruction, 100s; Void Chains ACTIVE/PvP one enemy within 15m, strong Slowness 2s while still able to fight, 80s; Overdrive ACTIVE Strength II + Speed II 6s, Weakness I 4s after, 120s. 8 Abyss: Null Field ACTIVE/PvP radius 6 for 5s prevents enemy players in field from STARTING new abilities, never cancels running abilities, 110s; Soul Drain ACTIVE/PvP enemy within 12m up to 4 hearts damage, heal up to 2 hearts limited to actual damage, 90s; Abyssal Guard PASSIVE modest knockback reduction, not immunity. 9 Transcendence: Time Fracture ACTIVE/PvP enemies within 7m Slowness III for 3s, allies unaffected, 150s; Singularity ACTIVE/PvP radius 5 for 4s pull then knockback burst and up to 4 hearts, 140s; Flux Lance ACTIVE/PvP visible beam max 25m stops at solid blocks, up to 8 hearts before armor, 120s. 10 Ascension: Worldbreaker ACTIVE/PvP radius 7, up to 6 hearts + knockback, visual destruction only, no blocks, 180s; Sovereign PASSIVE modest documented defensive bonus separate from major active buffs; Flux Beam ACTIVE/PvP charge 1.5s with warning sound/distinctive particles then Warden-style beam max 30m stopping at solid blocks, up to 16 hearts raw before armor/normal protections, visible directional counterplay, 240s.
Active/passive classification must be exactly as above. Use accurate menu lore/status.
Stage Err0r ability 31: Operator/Authority Override toggle, custom plugin authority boolean + error aura/prefix, owner only, revocable immediately, no actual OP.
TRANSFER: main menu button validates current owner; generate one unique Err0r Core item with strong appearance and lore plus persistent metadata token. Item droppable, chest-storable, transferable/restart-surviving. Before completing, deactivate all current effects/powers, atomically save STORED_IN_ITEM and token ID; then deliver item. On right-click, only exact server-tracked token and STORED_IN_ITEM can claim: atomically assign claimant UUID and consume token; failed persistence must not consume valid token. Former owner has no powers while stored. Forged/copied/replayed tokens fail. Handle transaction crash windows fail-closed; never duplicate the sole token. Do not trust display name/lore.
CLIENT PROTOCOL (must match Fabric task): Bukkit plugin messaging channel kodari:stage, versioned binary payload. Frame is: byte version=1, byte opcode, remaining opcode-specific body. Client->server opcodes 0x01 OPEN_MENU (no body), 0x02 ACTIVATE_EQUIPPED (no body), 0x03 DISABLE_ALL (no body). Server->client opcode 0x40 STATUS: byte code (0 ACCEPTED, 1 REJECTED, 2 COOLDOWN, 3 UNAVAILABLE, 4 DISABLED), signed 32-bit big-endian remaining cooldown milliseconds (0 if none), unsigned 16-bit big-endian UTF-8 byte length, then that many UTF-8 message bytes. Register Bukkit outgoing and incoming plugin channel properly. Server validates everything, replies safely for every request. Client opening menu should open the server-owned inventory; ordinary clicking does not use packets. Send client feedback through protocol and ordinary server UI. Never expose ownership data in protocol. Unknown versions/opcodes reject safely.
Use clean modular Java, Paper 1.21.11-compatible APIs, plugin.yml, config.yml only normal Teams settings and messages.yml. Ensure no extra secret config or commands. Add README/build/install instructions. Do not write tests/test files, do not claim tests or build. Aim complete; if an API compatibility uncertainty exists, choose conservative Paper APIs. No runtime test claim.