Continue
What would you like me to continue working on? Please provide the task or the last error/code context.
[Generation stopped]
XPkits — Standalone Kit Management Plugin — Paper 1.21+ / Java 21
Build a completely new, standalone plugin called XPkits. Do not modify, depend on, or copy code from any existing kit plugin. Package: dev.xpkits (or similar, must not collide with any known plugin's namespace).
DELIVERABLE Provide the full Maven source project (pom.xml + all classes + resources), structured so it compiles cleanly with mvn clean package on Java 21 against Paper 1.21+ API, producing XPkits.jar ready to drop into /plugins/. Note: if delivered by an assistant without a live build/test environment, the compiled jar cannot be produced or server-tested directly — build and smoke-test the source in an actual Paper 1.21+ environment before production use.
MAIN COMMAND: /kits
Subcommands: /kits /kits create <name> /kits delete <name> /kits rename <old> <new> /kits give <player> <kit> /kits list /kits reload /kits kitedit <kit> → Player Kit Editor /kits editkit <kit> → Admin Kit Editor
- Full tab completion for all subcommands and kit names.
- Permission check per subcommand before execution.
MAIN KIT INVENTORY GUI (/kits)
Modern premium PvP/Practice-style menu. Each kit entry shows:
- Custom icon
- Display name
- Description
- Required permission (shown only if locked)
- Cooldown remaining (live, if on cooldown)
- Preview button
- Use Kit button
Preview opens INSIDE the /kits menu (no separate /kits preview command) as a read-only INVENTORY GUI showing: full inventory, exact hotbar, armor, off-hand, potion effects, armor trims, shield (if present). Preview must never give, remove, or modify any player item — display-only clones.
PLAYER KIT EDITOR (/kits kitedit <kit>)
Lets a player customize their own personal loadout for that kit, without ever touching the kit's default/original definition.
Editable: inventory, hotbar, armor, off-hand, potion effects, armor trims, shield (only if the kit has one).
Main editor buttons — ONLY these, no extras:
- Save
- Reset (restores personal layout to the kit's default; show a confirmation menu first)
- Cancel (discards all unsaved changes from this session)
- Shield (present only if this kit includes a shield)
SAVE must capture, exactly: inventory slots, hotbar positions, armor, off-hand, potion effects (type, duration, amplifier), enchantments, attributes, lore, custom name, item components, armor trims, shield/banner data, item amounts.
ADMIN KIT EDITOR (/kits editkit <kit>)
Admin-only, edits the kit's actual default definition. Includes everything the player editor has, plus:
- Preview
- Import Inventory — imports the admin's current on-player setup (full inventory,
hotbar, armor, off-hand, potion effects, enchantments, attributes, lore, custom names, item components, armor trims, shield) into the kit being edited.
KIT CREATION (/kits create <name>)
Creates a new kit from the admin's current on-player setup, capturing the same full data set as Import Inventory.
ARMOR TRIM
No standalone "Armor Trim" button. Trim is edited by clicking the armor piece itself inside the editor:
Helmet → Helmet Trim Editor | Chestplate → Chestplate Trim Editor | Leggings → Leggings Trim Editor | Boots → Boots Trim Editor — editing only ever affects the clicked piece.
Must use real vanilla Minecraft 1.21+ ArmorTrim (TrimPattern + TrimMaterial via the item component / trim API). No fake NBT, no lore-based fake trims, no placeholder items — show actual vanilla trim patterns and materials in the picker.
TRIM PERMISSIONS
- xpkits.trim.half → player may trim up to 2 of their 4 armor pieces; player
chooses which 2 in the editor.
- xpkits.trim.full → player may trim all 4 pieces.
- Resolution order: if the player has xpkits.trim.full, that governs (all 4
available) regardless of also having .half. If only .half, cap at 2 and let the player pick which. If neither permission, trim editing is fully disabled (armor pieces are not clickable for trim purposes).
- Never auto-apply one trim to all pieces — each piece is edited individually.
SHIELD
The Shield button appears in BOTH the player and admin editors, and ONLY when the kit currently being edited contains a shield item. No disabled/greyed placeholder button when absent — it is fully hidden.
The button's visibility must re-evaluate live: if a shield is added to the kit mid-edit (e.g. via Import Inventory or manual placement), the button appears on next INVENTORY GUI refresh; if removed, it disappears on next refresh.
Shield Editor supports: base color, banner patterns (multiple, add/remove), per-pattern color, live preview, and saves complete vanilla shield/banner data.
Only the shield belonging to the current kit is editable here.
Permissions: xpkits.shield (required to open the Shield Editor at all), xpkits.shield.bypass (skips the permission check, for staff/admin use).
AUTO-REKIT
On confirmed kill, automatically restore the killer's personal saved layout for their active kit: inventory, hotbar, armor, off-hand, potion effects, armor trims, shield, enchantments, attributes, item components.
Configurable (per-kit, in that kit's yml): enable/disable, heal on rekit, feed on rekit, clear effects first, clear inventory first, sounds, messages, WorldGuard region restriction (only rekit inside listed regions, if WorldGuard is present).
Must never duplicate items — full inventory is authoritatively rebuilt from saved data, never merged with existing contents.
RESPAWN
On respawn, in configured order: clear inventory (if enabled) → give Kit Selector item (if enabled) → give selected/default kit (if enabled) → restore personal saved layout (if configured to do so instead of the default kit).
COOLDOWNS
Per-kit configurable cooldown, stored server-side per player (playerdata/<uuid>.yml, keyed by kit), not client- or session-derived.
Remaining cooldown shown live in the /kits menu.
Cooldown must be enforced identically regardless of entry point — command, INVENTORY GUI click, respawn-triggered kit give, Auto-Rekit, or reconnect — by checking the same stored timestamp in every code path, with no separate/parallel cooldown logic per feature.
STORAGE (auto-generated on first startup if missing)
plugins/XPkits/config.yml plugins/XPkits/messages.yml plugins/XPkits/KitEditor.yml plugins/XPkits/Trim.yml plugins/XPkits/Shield.yml plugins/XPkits/kits/<kit>.yml (one file per kit) plugins/XPkits/playerdata/<uuid>.yml (one file per player)
CONFIGURATION
Fully configurable via the files above: INVENTORY GUI titles, INVENTORY GUI sizes, slot layouts, materials, names, lore, hex colors, sounds, messages (all in messages.yml), permissions, cooldowns, kit icons, respawn behavior, Auto-Rekit behavior, kit behavior.
Each kit file (kits/<kit>.yml) stores: display name, description, icon, INVENTORY GUI slot, permission, cooldown, inventory, hotbar, armor, off-hand, potion effects, sounds, Auto-Rekit settings, respawn settings, preview data.
KITEDITOR.YML — FULL INVENTORY GUI CUSTOMIZATION
plugins/XPkits/KitEditor.yml must expose every structural and cosmetic element of both the Player Kit Editor and Admin Kit Editor as config values — nothing hardcoded in code. For EACH button/element (Save, Reset, Cancel, Shield, Preview, Import Inventory, and the four armor-piece trim slots):
- slot: <int> → exact inventory slot position in the editor INVENTORY GUI
- material: <Material> → item material/id shown for that button
- name: "<string>" → display name (hex/color codes supported)
- lore: ["<string>", ...] → lore lines (hex/color codes supported)
- glow: <true/false> → whether the item has an enchant glow
- custom-model-data: <int> → optional, for resource-pack icon support
Also configurable at the top level of KitEditor.yml:
- INVENTORY GUI-title-player: "<string>" → title for /kits kitedit
- INVENTORY GUI-title-admin: "<string>" → title for /kits editkit
- INVENTORY GUI-size-player: <int> → total slots, multiple of 9 (e.g. 54)
- INVENTORY GUI-size-admin: <int> → total slots, multiple of 9
- filler-material: <Material> → glass pane / background filler item
- filler-slots: [<int>, ...] → which slots receive the filler item
- confirmation-INVENTORY GUI: → same slot/material/name/lore/glow structure,
applied to the Reset confirmation menu's Confirm and Deny buttons
Validation rules:
- Every configured slot must be checked against 0 <= slot < INVENTORY GUI-size on load;
an invalid slot logs a clear warning naming the offending key and falls back to a safe built-in default slot rather than crashing plugin startup.
- Two buttons configured to the same slot logs a warning and the later one
in file order is skipped (first definition wins).
- Unknown Material values log a warning and fall back to BARRIER as a visible
"misconfigured" indicator, rather than silently failing.
- Reloading via /kits reload re-applies KitEditor.yml to any editors a player
re-opens afterward; editors already open when reload runs keep their current layout until closed (no live INVENTORY GUI mutation mid-session).
PLAYER DATA
playerdata/<uuid>.yml stores each player's personal per-kit layouts (from the Player Kit Editor) plus their per-kit cooldown timestamps. Must survive server restart, reconnect, respawn, Auto-Rekit, and plugin reload — loaded on join, saved asynchronously on every change and on quit.
ANTI-DUPLICATION / INVENTORY SAFETY (highest priority)
Using proper Paper InventoryClickEvent/InventoryDragEvent handling (cancel by default in all custody GUIs, only permit whitelisted actions), guard against: shift-click duplication, drag duplication, double-click exploits, number-key swap exploits, hotbar swap exploits, off-hand swap exploits, drop/pickup exploits, cursor-item duplication, INVENTORY GUI item extraction, rapid-click race conditions, disconnect-mid-edit exploits, death-during-edit exploits, restart-during-edit exploits, reload-during-edit exploits, Save/Cancel race exploits, kit duplication via repeated give/import, Auto-Rekit duplication, and preview item extraction.
Never trust client-reported inventory state — all edits are applied and validated server-side against the stored data model, and INVENTORY GUI sessions are snapshotted so a crash/disconnect mid-edit discards cleanly rather than partially committing.
COMPLETE ITEM DATA FIDELITY
Never lose, on any save/load/import/rekit cycle: inventory slots, hotbar positions, armor, off-hand, potion effects (with duration/amplifier), enchantments, attributes, lore, custom names, item components, armor trims, shield/banner data, item amounts.
UI STYLE
Premium modern PvP/Practice aesthetic: clean layouts, modern icons, short useful lore, hex colors, consistent sound feedback, confirmation menus before destructive actions, smooth navigation (back buttons, no dead ends), fully configurable INVENTORY GUI titles/sizes/materials per the config files above.
COMPATIBILITY
Paper 1.21+, Java 21. PlaceholderAPI as soft dependency (expansion optional).
WorldGuard 7+ as soft dependency (only used for Auto-Rekit region restriction).
No other required dependencies.
EXPLICITLY OUT OF SCOPE
No gamemode systems, arena systems, queues, matchmaking, duels, practice matchmaking, or FFA management of any kind. Scope is strictly: Kit INVENTORY GUI + in-menu Preview + Player Kit Editor + Admin Kit Editor + Import Inventory + Kit Creation + Potion Effects + vanilla Armor Trim + Shield/banner editing + Auto-Rekit + Respawn handling + per-player data + anti-duplication.
ACCEPTANCE CRITERIA
- All listed commands functional with tab completion and permission gating.
- All config/message/kit/playerdata files auto-generate with sane defaults on
first run.
- No item loss or duplication achievable through any listed exploit vector,
verified via manual testing on a live Paper 1.21+ test server before deployment to production.
- Shield button visibility and trim permission resolution behave exactly as
specified above in both editors.
- Every slot/material/name/lore/glow value in KitEditor.yml is respected on
INVENTORY GUI build with no hardcoded fallback overriding a valid config value.
Establish the Maven project structure and existing source/resources.
Implement the core kit data model, YAML persistence, configuration defaults, and shared cooldown/rebuild services.
Add
/kitscommands, permissions, tab completion, and kit creation/administration flows.Add the configurable player/admin GUIs, preview, editors, shield/trim editors, and inventory-safety handling.
Add respawn/kill/reconnect behavior, then review cross-file consistency and package the complete source project.
Implemented the XPkits Maven Paper plugin foundation and core features:
Added safer kit/player snapshot persistence and null handling.
Added configurable main menu and preview settings.
Added command permission gating and improved tab completion.
Added selected-kit persistence and respawn behavior.
Added configurable editor off-hand slot.
Added session-safe editor cursor handling and server-side inventory swaps.
Added admin import/save and player personal-layout save/reset flows.
Added vanilla trim picker using Paper’s
ArmorTrim,TrimPattern, andTrimMaterialAPIs.Added shield color and banner-pattern editing.
Added live shield-button visibility.
Added duplicate editor-slot warnings and material fallback behavior.
Hardened GUI handling against drag, pickup, drop, hotbar, swap, shift-click, and collect-to-cursor actions.
Added configuration accessors for
Trim.yml,Shield.yml, and the main config.
The project source is not compiled or server-tested here, so it should still be verified with:
mvn clean package
and then smoke-tested on a Paper 1.21+ server.
Continue
What would you like me to continue with? Please provide the task or the last error/output.
Xpkits
What should I continue on in XPkits—a specific bug, feature, command, GUI, or build error?
XPkits — Standalone Kit Management Plugin — Paper 1.21+ / Java 21
Build a completely new, standalone plugin called XPkits. Do not modify, depend on, or copy code from any existing kit plugin. Package: dev.xpkits (or similar, must not collide with any known plugin's namespace).
DELIVERABLE Provide the full Maven source project (pom.xml + all classes + resources), structured so it compiles cleanly with mvn clean package on Java 21 against Paper 1.21+ API, producing XPkits.jar ready to drop into /plugins/. Note: if delivered by an assistant without a live build/test environment, the compiled jar cannot be produced or server-tested directly — build and smoke-test the source in an actual Paper 1.21+ environment before production use.
MAIN COMMAND: /kits
Subcommands: /kits /kits create <name> /kits delete <name> /kits rename <old> <new> /kits give <player> <kit> /kits list /kits reload /kits kitedit <kit> → Player Kit Editor /kits editkit <kit> → Admin Kit Editor
- Full tab completion for all subcommands and kit names.
- Permission check per subcommand before execution.
MAIN KIT INVENTORY GUI (/kits)
Modern premium PvP/Practice-style menu. Each kit entry shows:
- Custom icon
- Display name
- Description
- Required permission (shown only if locked)
- Cooldown remaining (live, if on cooldown)
- Preview button
- Use Kit button
Preview opens INSIDE the /kits menu (no separate /kits preview command) as a read-only INVENTORY GUI showing: full inventory, exact hotbar, armor, off-hand, potion effects, armor trims, shield (if present). Preview must never give, remove, or modify any player item — display-only clones.
PLAYER KIT EDITOR (/kits kitedit <kit>)
Lets a player customize their own personal loadout for that kit, without ever touching the kit's default/original definition.
Editable: inventory, hotbar, armor, off-hand, potion effects, armor trims, shield (only if the kit has one).
Main editor buttons — ONLY these, no extras:
- Save
- Reset (restores personal layout to the kit's default; show a confirmation menu first)
- Cancel (discards all unsaved changes from this session)
- Shield (present only if this kit includes a shield)
SAVE must capture, exactly: inventory slots, hotbar positions, armor, off-hand, potion effects (type, duration, amplifier), enchantments, attributes, lore, custom name, item components, armor trims, shield/banner data, item amounts.
ADMIN KIT EDITOR (/kits editkit <kit>)
Admin-only, edits the kit's actual default definition. Includes everything the player editor has, plus:
- Preview
- Import Inventory — imports the admin's current on-player setup (full inventory,
hotbar, armor, off-hand, potion effects, enchantments, attributes, lore, custom names, item components, armor trims, shield) into the kit being edited.
KIT CREATION (/kits create <name>)
Creates a new kit from the admin's current on-player setup, capturing the same full data set as Import Inventory.
ARMOR TRIM
No standalone "Armor Trim" button. Trim is edited by clicking the armor piece itself inside the editor:
Helmet → Helmet Trim Editor | Chestplate → Chestplate Trim Editor | Leggings → Leggings Trim Editor | Boots → Boots Trim Editor — editing only ever affects the clicked piece.
Must use real vanilla Minecraft 1.21+ ArmorTrim (TrimPattern + TrimMaterial via the item component / trim API). No fake NBT, no lore-based fake trims, no placeholder items — show actual vanilla trim patterns and materials in the picker.
TRIM PERMISSIONS
- xpkits.trim.half → player may trim up to 2 of their 4 armor pieces; player
chooses which 2 in the editor.
- xpkits.trim.full → player may trim all 4 pieces.
- Resolution order: if the player has xpkits.trim.full, that governs (all 4
available) regardless of also having .half. If only .half, cap at 2 and let the player pick which. If neither permission, trim editing is fully disabled (armor pieces are not clickable for trim purposes).
- Never auto-apply one trim to all pieces — each piece is edited individually.
SHIELD
The Shield button appears in BOTH the player and admin editors, and ONLY when the kit currently being edited contains a shield item. No disabled/greyed placeholder button when absent — it is fully hidden.
The button's visibility must re-evaluate live: if a shield is added to the kit mid-edit (e.g. via Import Inventory or manual placement), the button appears on next INVENTORY GUI refresh; if removed, it disappears on next refresh.
Shield Editor supports: base color, banner patterns (multiple, add/remove), per-pattern color, live preview, and saves complete vanilla shield/banner data.
Only the shield belonging to the current kit is editable here.
Permissions: xpkits.shield (required to open the Shield Editor at all), xpkits.shield.bypass (skips the permission check, for staff/admin use).
AUTO-REKIT
On confirmed kill, automatically restore the killer's personal saved layout for their active kit: inventory, hotbar, armor, off-hand, potion effects, armor trims, shield, enchantments, attributes, item components.
Configurable (per-kit, in that kit's yml): enable/disable, heal on rekit, feed on rekit, clear effects first, clear inventory first, sounds, messages, WorldGuard region restriction (only rekit inside listed regions, if WorldGuard is present).
Must never duplicate items — full inventory is authoritatively rebuilt from saved data, never merged with existing contents.
RESPAWN
On respawn, in configured order: clear inventory (if enabled) → give Kit Selector item (if enabled) → give selected/default kit (if enabled) → restore personal saved layout (if configured to do so instead of the default kit).
COOLDOWNS
Per-kit configurable cooldown, stored server-side per player (playerdata/<uuid>.yml, keyed by kit), not client- or session-derived.
Remaining cooldown shown live in the /kits menu.
Cooldown must be enforced identically regardless of entry point — command, INVENTORY GUI click, respawn-triggered kit give, Auto-Rekit, or reconnect — by checking the same stored timestamp in every code path, with no separate/parallel cooldown logic per feature.
STORAGE (auto-generated on first startup if missing)
plugins/XPkits/config.yml plugins/XPkits/messages.yml plugins/XPkits/KitEditor.yml plugins/XPkits/Trim.yml plugins/XPkits/Shield.yml plugins/XPkits/kits/<kit>.yml (one file per kit) plugins/XPkits/playerdata/<uuid>.yml (one file per player)
CONFIGURATION
Fully configurable via the files above: INVENTORY GUI titles, INVENTORY GUI sizes, slot layouts, materials, names, lore, hex colors, sounds, messages (all in messages.yml), permissions, cooldowns, kit icons, respawn behavior, Auto-Rekit behavior, kit behavior.
Each kit file (kits/<kit>.yml) stores: display name, description, icon, INVENTORY GUI slot, permission, cooldown, inventory, hotbar, armor, off-hand, potion effects, sounds, Auto-Rekit settings, respawn settings, preview data.
KITEDITOR.YML — FULL INVENTORY GUI CUSTOMIZATION
plugins/XPkits/KitEditor.yml must expose every structural and cosmetic element of both the Player Kit Editor and Admin Kit Editor as config values — nothing hardcoded in code. For EACH button/element (Save, Reset, Cancel, Shield, Preview, Import Inventory, and the four armor-piece trim slots):
- slot: <int> → exact inventory slot position in the editor INVENTORY GUI
- material: <Material> → item material/id shown for that button
- name: "<string>" → display name (hex/color codes supported)
- lore: ["<string>", ...] → lore lines (hex/color codes supported)
- glow: <true/false> → whether the item has an enchant glow
- custom-model-data: <int> → optional, for resource-pack icon support
Also configurable at the top level of KitEditor.yml:
- INVENTORY GUI-title-player: "<string>" → title for /kits kitedit
- INVENTORY GUI-title-admin: "<string>" → title for /kits editkit
- INVENTORY GUI-size-player: <int> → total slots, multiple of 9 (e.g. 54)
- INVENTORY GUI-size-admin: <int> → total slots, multiple of 9
- filler-material: <Material> → glass pane / background filler item
- filler-slots: [<int>, ...] → which slots receive the filler item
- confirmation-INVENTORY GUI: → same slot/material/name/lore/glow structure,
applied to the Reset confirmation menu's Confirm and Deny buttons
Validation rules:
- Every configured slot must be checked against 0 <= slot < INVENTORY GUI-size on load;
an invalid slot logs a clear warning naming the offending key and falls back to a safe built-in default slot rather than crashing plugin startup.
- Two buttons configured to the same slot logs a warning and the later one
in file order is skipped (first definition wins).
- Unknown Material values log a warning and fall back to BARRIER as a visible
"misconfigured" indicator, rather than silently failing.
- Reloading via /kits reload re-applies KitEditor.yml to any editors a player
re-opens afterward; editors already open when reload runs keep their current layout until closed (no live INVENTORY GUI mutation mid-session).
PLAYER DATA
playerdata/<uuid>.yml stores each player's personal per-kit layouts (from the Player Kit Editor) plus their per-kit cooldown timestamps. Must survive server restart, reconnect, respawn, Auto-Rekit, and plugin reload — loaded on join, saved asynchronously on every change and on quit.
ANTI-DUPLICATION / INVENTORY SAFETY (highest priority)
Using proper Paper InventoryClickEvent/InventoryDragEvent handling (cancel by default in all custody GUIs, only permit whitelisted actions), guard against: shift-click duplication, drag duplication, double-click exploits, number-key swap exploits, hotbar swap exploits, off-hand swap exploits, drop/pickup exploits, cursor-item duplication, INVENTORY GUI item extraction, rapid-click race conditions, disconnect-mid-edit exploits, death-during-edit exploits, restart-during-edit exploits, reload-during-edit exploits, Save/Cancel race exploits, kit duplication via repeated give/import, Auto-Rekit duplication, and preview item extraction.
Never trust client-reported inventory state — all edits are applied and validated server-side against the stored data model, and INVENTORY GUI sessions are snapshotted so a crash/disconnect mid-edit discards cleanly rather than partially committing.
COMPLETE ITEM DATA FIDELITY
Never lose, on any save/load/import/rekit cycle: inventory slots, hotbar positions, armor, off-hand, potion effects (with duration/amplifier), enchantments, attributes, lore, custom names, item components, armor trims, shield/banner data, item amounts.
UI STYLE
Premium modern PvP/Practice aesthetic: clean layouts, modern icons, short useful lore, hex colors, consistent sound feedback, confirmation menus before destructive actions, smooth navigation (back buttons, no dead ends), fully configurable INVENTORY GUI titles/sizes/materials per the config files above.
COMPATIBILITY
Paper 1.21+, Java 21. PlaceholderAPI as soft dependency (expansion optional).
WorldGuard 7+ as soft dependency (only used for Auto-Rekit region restriction).
No other required dependencies.
EXPLICITLY OUT OF SCOPE
No gamemode systems, arena systems, queues, matchmaking, duels, practice matchmaking, or FFA management of any kind. Scope is strictly: Kit INVENTORY GUI + in-menu Preview + Player Kit Editor + Admin Kit Editor + Import Inventory + Kit Creation + Potion Effects + vanilla Armor Trim + Shield/banner editing + Auto-Rekit + Respawn handling + per-player data + anti-duplication.
ACCEPTANCE CRITERIA
- All listed commands functional with tab completion and permission gating.
- All config/message/kit/playerdata files auto-generate with sane defaults on
first run.
- No item loss or duplication achievable through any listed exploit vector,
verified via manual testing on a live Paper 1.21+ test server before deployment to production.
- Shield button visibility and trim permission resolution behave exactly as
specified above in both editors.
- Every slot/material/name/lore/glow value in KitEditor.yml is respected on
INVENTORY GUI build with no hardcoded fallback overriding a valid config value.
Inspect the repository and determine whether a Maven project already exists.
Establish the standalone XPkits foundation: Maven metadata, plugin entrypoint, storage/config generation, and command skeleton.
Add the kit data model, safe serialization, cooldown service, and persistence.
Add the configurable kit/player/admin GUIs, preview flow, trim/shield editors, and anti-exploit event handling.
Add respawn/auto-rekit behavior, tab completion, permissions, and resources, then review cross-file consistency.
The project already contains an XPkits Maven skeleton, so I’m continuing from that source rather than creating a second plugin. The immediate priority is the remaining GUI/config/model code and compile-risk audit before extending behavior.
I found the main correctness gaps in the existing implementation: kit permissions were not enforced in the shared give path, preview omitted potion effects, the editor’s default off-hand slot collided with the Shield button, shield base color was being treated as a banner pattern, and shutdown did not flush cached player data. I’m fixing those shared paths now so command, GUI, respawn, and auto-rekit behavior stay consistent.
The shared permission and shutdown fixes are landed. I’m now correcting the menu layout collision and making the read-only previews represent potion effects without ever exposing mutable session state.
The preview-slot collision is fixed, and I’m tightening the editor contract now: player sessions will no longer expose admin-only controls, editor slots will validate against both configured GUI sizes, and respawn will honor a configured default kit when no selected kit exists.
The remaining gaps are configuration fidelity and input validation rather than a new subsystem. I’m wiring the existing Trim/Shield resource settings into their GUIs and rejecting invalid rename targets before any kit file is moved.
The core source is already present and the requested behavior is being completed incrementally rather than duplicated. One remaining explicit feature is the optional WorldGuard region gate for Auto-Rekit; I’m adding it through reflection so WorldGuard remains a true soft dependency and the jar still compiles without WorldGuard classes.XPkits is already structured as a standalone Maven Paper 1.21+/Java 21 plugin under dev.xpkits. I continued the implementation with these fixes:
Enforced kit permissions through the shared
KitService.give(...)path.Added target-permission validation for
/kits give.Added synchronous shutdown persistence for cached player data.
Fixed the editor off-hand slot collision with the Shield button.
Added configurable preview slots to the main menu.
Added potion-effect information to read-only previews.
Corrected shield base-color editing to use vanilla
BannerMeta#setBaseColor.Hid admin-only editor controls from player editors.
Added respawn default-kit support.
Added kit-name validation during rename.
Wired Trim and Shield GUI materials to their configuration files.
Added optional WorldGuard Auto-Rekit region filtering without making WorldGuard a hard compile dependency.
The project still requires a real Paper 1.21+ server smoke test for the anti-duplication and full item-component fidelity acceptance criteria.
Download
What would you like to download? Send the file, URL, plugin name, or repository link.
XPkits — Standalone Kit Management Plugin — Paper 1.21+ / Java 21
Build a completely new, standalone plugin called XPkits. Do not modify, depend on, or copy code from any existing kit plugin. Package: dev.xpkits (or similar, must not collide with any known plugin's namespace).
DELIVERABLE Provide the full Maven source project (pom.xml + all classes + resources), structured so it compiles cleanly with mvn clean package on Java 21 against Paper 1.21+ API, producing XPkits.jar ready to drop into /plugins/. Note: if delivered by an assistant without a live build/test environment, the compiled jar cannot be produced or server-tested directly — build and smoke-test the source in an actual Paper 1.21+ environment before production use.
MAIN COMMAND: /kits
Subcommands: /kits /kits create <name> /kits delete <name> /kits rename <old> <new> /kits give <player> <kit> /kits list /kits reload /kits kitedit <kit> → Player Kit Editor /kits editkit <kit> → Admin Kit Editor
- Full tab completion for all subcommands and kit names.
- Permission check per subcommand before execution.
MAIN KIT INVENTORY GUI (/kits)
Modern premium PvP/Practice-style menu. Each kit entry shows:
- Custom icon
- Display name
- Description
- Required permission (shown only if locked)
- Cooldown remaining (live, if on cooldown)
- Preview button
- Use Kit button
Preview opens INSIDE the /kits menu (no separate /kits preview command) as a read-only INVENTORY GUI showing: full inventory, exact hotbar, armor, off-hand, potion effects, armor trims, shield (if present). Preview must never give, remove, or modify any player item — display-only clones.
PLAYER KIT EDITOR (/kits kitedit <kit>)
Lets a player customize their own personal loadout for that kit, without ever touching the kit's default/original definition.
Editable: inventory, hotbar, armor, off-hand, potion effects, armor trims, shield (only if the kit has one).
Main editor buttons — ONLY these, no extras:
- Save
- Reset (restores personal layout to the kit's default; show a confirmation menu first)
- Cancel (discards all unsaved changes from this session)
- Shield (present only if this kit includes a shield)
SAVE must capture, exactly: inventory slots, hotbar positions, armor, off-hand, potion effects (type, duration, amplifier), enchantments, attributes, lore, custom name, item components, armor trims, shield/banner data, item amounts.
ADMIN KIT EDITOR (/kits editkit <kit>)
Admin-only, edits the kit's actual default definition. Includes everything the player editor has, plus:
- Preview
- Import Inventory — imports the admin's current on-player setup (full inventory,
hotbar, armor, off-hand, potion effects, enchantments, attributes, lore, custom names, item components, armor trims, shield) into the kit being edited.
KIT CREATION (/kits create <name>)
Creates a new kit from the admin's current on-player setup, capturing the same full data set as Import Inventory.
ARMOR TRIM
No standalone "Armor Trim" button. Trim is edited by clicking the armor piece itself inside the editor:
Helmet → Helmet Trim Editor | Chestplate → Chestplate Trim Editor | Leggings → Leggings Trim Editor | Boots → Boots Trim Editor — editing only ever affects the clicked piece.
Must use real vanilla Minecraft 1.21+ ArmorTrim (TrimPattern + TrimMaterial via the item component / trim API). No fake NBT, no lore-based fake trims, no placeholder items — show actual vanilla trim patterns and materials in the picker.
TRIM PERMISSIONS
- xpkits.trim.half → player may trim up to 2 of their 4 armor pieces; player
chooses which 2 in the editor.
- xpkits.trim.full → player may trim all 4 pieces.
- Resolution order: if the player has xpkits.trim.full, that governs (all 4
available) regardless of also having .half. If only .half, cap at 2 and let the player pick which. If neither permission, trim editing is fully disabled (armor pieces are not clickable for trim purposes).
- Never auto-apply one trim to all pieces — each piece is edited individually.
SHIELD
The Shield button appears in BOTH the player and admin editors, and ONLY when the kit currently being edited contains a shield item. No disabled/greyed placeholder button when absent — it is fully hidden.
The button's visibility must re-evaluate live: if a shield is added to the kit mid-edit (e.g. via Import Inventory or manual placement), the button appears on next INVENTORY GUI refresh; if removed, it disappears on next refresh.
Shield Editor supports: base color, banner patterns (multiple, add/remove), per-pattern color, live preview, and saves complete vanilla shield/banner data.
Only the shield belonging to the current kit is editable here.
Permissions: xpkits.shield (required to open the Shield Editor at all), xpkits.shield.bypass (skips the permission check, for staff/admin use).
AUTO-REKIT
On confirmed kill, automatically restore the killer's personal saved layout for their active kit: inventory, hotbar, armor, off-hand, potion effects, armor trims, shield, enchantments, attributes, item components.
Configurable (per-kit, in that kit's yml): enable/disable, heal on rekit, feed on rekit, clear effects first, clear inventory first, sounds, messages, WorldGuard region restriction (only rekit inside listed regions, if WorldGuard is present).
Must never duplicate items — full inventory is authoritatively rebuilt from saved data, never merged with existing contents.
RESPAWN
On respawn, in configured order: clear inventory (if enabled) → give Kit Selector item (if enabled) → give selected/default kit (if enabled) → restore personal saved layout (if configured to do so instead of the default kit).
COOLDOWNS
Per-kit configurable cooldown, stored server-side per player (playerdata/<uuid>.yml, keyed by kit), not client- or session-derived.
Remaining cooldown shown live in the /kits menu.
Cooldown must be enforced identically regardless of entry point — command, INVENTORY GUI click, respawn-triggered kit give, Auto-Rekit, or reconnect — by checking the same stored timestamp in every code path, with no separate/parallel cooldown logic per feature.
STORAGE (auto-generated on first startup if missing)
plugins/XPkits/config.yml plugins/XPkits/messages.yml plugins/XPkits/KitEditor.yml plugins/XPkits/Trim.yml plugins/XPkits/Shield.yml plugins/XPkits/kits/<kit>.yml (one file per kit) plugins/XPkits/playerdata/<uuid>.yml (one file per player)
CONFIGURATION
Fully configurable via the files above: INVENTORY GUI titles, INVENTORY GUI sizes, slot layouts, materials, names, lore, hex colors, sounds, messages (all in messages.yml), permissions, cooldowns, kit icons, respawn behavior, Auto-Rekit behavior, kit behavior.
Each kit file (kits/<kit>.yml) stores: display name, description, icon, INVENTORY GUI slot, permission, cooldown, inventory, hotbar, armor, off-hand, potion effects, sounds, Auto-Rekit settings, respawn settings, preview data.
KITEDITOR.YML — FULL INVENTORY GUI CUSTOMIZATION
plugins/XPkits/KitEditor.yml must expose every structural and cosmetic element of both the Player Kit Editor and Admin Kit Editor as config values — nothing hardcoded in code. For EACH button/element (Save, Reset, Cancel, Shield, Preview, Import Inventory, and the four armor-piece trim slots):
- slot: <int> → exact inventory slot position in the editor INVENTORY GUI
- material: <Material> → item material/id shown for that button
- name: "<string>" → display name (hex/color codes supported)
- lore: ["<string>", ...] → lore lines (hex/color codes supported)
- glow: <true/false> → whether the item has an enchant glow
- custom-model-data: <int> → optional, for resource-pack icon support
Also configurable at the top level of KitEditor.yml:
- INVENTORY GUI-title-player: "<string>" → title for /kits kitedit
- INVENTORY GUI-title-admin: "<string>" → title for /kits editkit
- INVENTORY GUI-size-player: <int> → total slots, multiple of 9 (e.g. 54)
- INVENTORY GUI-size-admin: <int> → total slots, multiple of 9
- filler-material: <Material> → glass pane / background filler item
- filler-slots: [<int>, ...] → which slots receive the filler item
- confirmation-INVENTORY GUI: → same slot/material/name/lore/glow structure,
applied to the Reset confirmation menu's Confirm and Deny buttons
Validation rules:
- Every configured slot must be checked against 0 <= slot < INVENTORY GUI-size on load;
an invalid slot logs a clear warning naming the offending key and falls back to a safe built-in default slot rather than crashing plugin startup.
- Two buttons configured to the same slot logs a warning and the later one
in file order is skipped (first definition wins).
- Unknown Material values log a warning and fall back to BARRIER as a visible
"misconfigured" indicator, rather than silently failing.
- Reloading via /kits reload re-applies KitEditor.yml to any editors a player
re-opens afterward; editors already open when reload runs keep their current layout until closed (no live INVENTORY GUI mutation mid-session).
PLAYER DATA
playerdata/<uuid>.yml stores each player's personal per-kit layouts (from the Player Kit Editor) plus their per-kit cooldown timestamps. Must survive server restart, reconnect, respawn, Auto-Rekit, and plugin reload — loaded on join, saved asynchronously on every change and on quit.
ANTI-DUPLICATION / INVENTORY SAFETY (highest priority)
Using proper Paper InventoryClickEvent/InventoryDragEvent handling (cancel by default in all custody GUIs, only permit whitelisted actions), guard against: shift-click duplication, drag duplication, double-click exploits, number-key swap exploits, hotbar swap exploits, off-hand swap exploits, drop/pickup exploits, cursor-item duplication, INVENTORY GUI item extraction, rapid-click race conditions, disconnect-mid-edit exploits, death-during-edit exploits, restart-during-edit exploits, reload-during-edit exploits, Save/Cancel race exploits, kit duplication via repeated give/import, Auto-Rekit duplication, and preview item extraction.
Never trust client-reported inventory state — all edits are applied and validated server-side against the stored data model, and INVENTORY GUI sessions are snapshotted so a crash/disconnect mid-edit discards cleanly rather than partially committing.
COMPLETE ITEM DATA FIDELITY
Never lose, on any save/load/import/rekit cycle: inventory slots, hotbar positions, armor, off-hand, potion effects (with duration/amplifier), enchantments, attributes, lore, custom names, item components, armor trims, shield/banner data, item amounts.
UI STYLE
Premium modern PvP/Practice aesthetic: clean layouts, modern icons, short useful lore, hex colors, consistent sound feedback, confirmation menus before destructive actions, smooth navigation (back buttons, no dead ends), fully configurable INVENTORY GUI titles/sizes/materials per the config files above.
COMPATIBILITY
Paper 1.21+, Java 21. PlaceholderAPI as soft dependency (expansion optional).
WorldGuard 7+ as soft dependency (only used for Auto-Rekit region restriction).
No other required dependencies.
EXPLICITLY OUT OF SCOPE
No gamemode systems, arena systems, queues, matchmaking, duels, practice matchmaking, or FFA management of any kind. Scope is strictly: Kit INVENTORY GUI + in-menu Preview + Player Kit Editor + Admin Kit Editor + Import Inventory + Kit Creation + Potion Effects + vanilla Armor Trim + Shield/banner editing + Auto-Rekit + Respawn handling + per-player data + anti-duplication.
ACCEPTANCE CRITERIA
- All listed commands functional with tab completion and permission gating.
- All config/message/kit/playerdata files auto-generate with sane defaults on
first run.
- No item loss or duplication achievable through any listed exploit vector,
verified via manual testing on a live Paper 1.21+ test server before deployment to production.
- Shield button visibility and trim permission resolution behave exactly as
specified above in both editors.
- Every slot/material/name/lore/glow value in KitEditor.yml is respected on
INVENTORY GUI build with no hardcoded fallback overriding a valid config value.
Inspect the repository and build setup to determine whether XPkits is a new project or an existing codebase.
Scaffold the Maven/Paper plugin and core configuration/storage models.
Implement commands, kit management, GUI sessions/editors, fidelity-preserving item serialization, cooldowns, respawn, and auto-rekit.
Add trim/shield editing, validation, tab completion, resources, and plugin registration.
The existing project already covers the requested standalone structure, so I’m tightening the acceptance-critical paths rather than creating duplicate classes: live cooldown rendering, authoritative player-data writes, shield pattern editing, and safer editor-session handling.
The core project is present and compiles by structure; I found one behavior conflict with the requested respawn ordering: kit application could clear the selector that had just been granted. I’m separating respawn’s pre-clear from kit application while keeping the same centralized cooldown check.
Implemented and completed the XPkits Maven source project under dev.xpkits, including:
Paper 1.21.4 / Java 21 Maven setup
/kitscommand suite with permissions and tab completionKit creation, deletion, rename, give, reload, listing, and editing
Main kit GUI with live cooldown display
Read-only kit and loadout previews
Player and admin kit editors
Reset confirmation, save, cancel, import, and shield visibility handling
Vanilla ArmorTrim editing through Paper’s trim API
Shield base colors and banner pattern editing
Per-player personal layouts and cooldown persistence
ItemStack serialization preserving modern item metadata/components
Auto-rekit and respawn handling
WorldGuard region restriction support through soft dependency/reflection
Inventory GUI protection against drag, shift-click, number-key, drop, pickup, and off-hand exploits
Editor cleanup on disconnect/death
Config validation for editor sizes, button slots, duplicate slots, and invalid materials
Auto-generated configuration/resource files
The project produces XPkits.jar with:
mvn clean package
I could not execute Maven or perform live Paper-server smoke testing in this environment, so the resulting source should still be compiled and manually tested on a Paper 1.21+ server before production deployment.
Just give me plugin
What should the plugin do?
Send me:
Plugin name
Main features
Minecraft/server version
Any commands, permissions, or configuration needed
Xpkits
What should XPKits do?
For example:
/kit <name>commandsXP-based kit purchases
Kit cooldowns
GUI kit selection
Permissions
Configurable items and costs
Also specify your Minecraft version.
package dev.xpkits;
import dev.xpkits.command.KitsCommand;
import dev.xpkits.config.ConfigFiles;
import dev.xpkits.config.EditorSettings;
import dev.xpkits.gui.GuiListener;
import dev.xpkits.gui.GuiManager;
import dev.xpkits.gui.XPkitsAccess;
import dev.xpkits.model.KitData;
import dev.xpkits.service.KitService;
import dev.xpkits.storage.KitRepository;
import dev.xpkits.storage.PlayerDataRepository;
import dev.xpkits.util.Text;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Map;
import java.util.List;
import java.util.Locale;
public class XPkitsPlugin extends JavaPlugin implements Listener, XPkitsAccess {
private ConfigFiles files;
private EditorSettings editorSettings;
private KitRepository repository;
private PlayerDataRepository playerRepository;
private KitService kits;
private GuiManager guis;
@Override public void onEnable() {
saveDefaultConfig();
files = new ConfigFiles(this); files.load();
editorSettings = new EditorSettings(this, files.editor());
repository = new KitRepository(this);
playerRepository = new PlayerDataRepository(this);
kits = new KitService(repository, playerRepository);
guis = new GuiManager(this);
getServer().getPluginManager().registerEvents(new GuiListener(guis), this);
getServer().getPluginManager().registerEvents(this, this);
KitsCommand command = new KitsCommand(this);
if (getCommand("kits") != null) {
getCommand("kits").setExecutor(command);
getCommand("kits").setTabCompleter(command);
}
}
@Override public void onDisable() {
if (playerRepository != null) playerRepository.saveAll();
}
public void reloadPluginData() {
reloadConfig(); files.load(); editorSettings = new EditorSettings(this, files.editor()); kits.reload();
}
@EventHandler public void join(PlayerJoinEvent event) { playerRepository.load(event.getPlayer().getUniqueId()); }
@EventHandler public void quit(PlayerQuitEvent event) { playerRepository.unload(event.getPlayer().getUniqueId()); }
@EventHandler public void respawn(PlayerRespawnEvent event) {
Player player = event.getPlayer();
Bukkit.getScheduler().runTask(this, () -> {
if (getConfig().getBoolean("respawn.clear-inventory", true)) player.getInventory().clear();
KitData kit = null;
String selected = playerRepository.get(player.getUniqueId()).getSelectedKit();
if (selected == null || selected.isBlank()) selected = getConfig().getString("respawn.default-kit", "");
kit = kits.get(selected);
if (getConfig().getBoolean("respawn.give-selector", false)) {
String material = getConfig().getString("selector.material", "NETHER_STAR");
player.getInventory().addItem(dev.xpkits.util.Items.icon(
dev.xpkits.util.Items.material(material, org.bukkit.Material.NETHER_STAR),
getConfig().getString("selector.name", "&bKit Selector"),
getConfig().getStringList("selector.lore"), false, 0));
}
if (kit != null && (kit.isRespawnGive() || getConfig().getBoolean("respawn.give-selected-kit", false))) {
boolean personal = kit.isRespawnPersonal()
|| getConfig().getBoolean("respawn.restore-personal-layout", false);
kits.give(player, kit, personal, true, false);
}
});
}
@EventHandler public void death(PlayerDeathEvent event) {
Player killer = event.getEntity().getKiller();
if (killer == null) return;
KitData kit = kits.get(playerRepository.get(killer.getUniqueId()).getSelectedKit());
if (kit != null && kit.isAutoRekit() && inRekitRegion(killer, kit.getRekitRegions())) {
Bukkit.getScheduler().runTask(this, () -> kits.give(killer, kit, true, true));
}
}
private boolean inRekitRegion(Player player, List<String> configuredRegions) {
if (configuredRegions == null || configuredRegions.isEmpty()) return true;
if (getServer().getPluginManager().getPlugin("WorldGuard") == null) return true;
try {
Class<?> adapter = Class.forName("com.sk89q.worldedit.bukkit.BukkitAdapter");
Object location = adapter.getMethod("adapt", org.bukkit.Location.class).invoke(null, player.getLocation());
Class<?> worldGuardClass = Class.forName("com.sk89q.worldguard.WorldGuard");
Object worldGuard = worldGuardClass.getMethod("getInstance").invoke(null);
Object platform = worldGuardClass.getMethod("getPlatform").invoke(worldGuard);
Object query = platform.getClass().getMethod("getRegionContainer").invoke(platform);
Object regionQuery = query.getClass().getMethod("createQuery").invoke(query);
Object regions = regionQuery.getClass().getMethod("getApplicableRegions", location.getClass()).invoke(regionQuery, location);
for (Object region : (Iterable<?>) regions) {
String id = String.valueOf(region.getClass().getMethod("getId").invoke(region));
for (String configured : configuredRegions) if (id.equalsIgnoreCase(configured)) return true;
}
return false;
} catch (ReflectiveOperationException | RuntimeException exception) {
getLogger().warning("Could not query WorldGuard Auto-Rekit regions: " + exception.getMessage());
return true;
}
}
public void message(CommandSender sender, String key, Map<String, String> replacements) {
String message = files.messages().getString(key, key);
for (Map.Entry<String, String> entry : replacements.entrySet()) message = message.replace("{" + entry.getKey() + "}", entry.getValue());
sender.sendMessage(Text.color(files.messages().getString("prefix", "") + message));
}
public ConfigFiles files() { return files; }
public EditorSettings editorSettings() { return editorSettings; }
public KitRepository repository() { return repository; }
public KitService kits() { return kits; }
public GuiManager guis() { return guis; }
@Override public org.bukkit.configuration.file.FileConfiguration config() { return getConfig(); }
@Override public org.bukkit.plugin.Plugin plugin() { return this; }
@Override public void saveKit(KitData kit) { repository.save(kit); }
}