Create a complete Minecraft Paper plugin called "FragmentSMP" for Paper 1.21.x (Java 21). No external dependencies. Produce clean, well-organized code (separate classes for fragments, cooldowns, GUIs, listeners, data storage, and commands), a plugin.yml, and a fully commented config.yml where every number below is configurable. Include the complete source and build file (Maven or Gradle).
=== OVERVIEW === Every player gets one random "Fragment", a custom item with a unique ability, like gems on Bliss SMP. Fragments can be taken from other players by killing them. If a single player collects one of every fragment type, they can forge the "Death Gem", a one-of-a-kind overpowered gem. An admin menu controls the SMP start, which runs a cinematic fragment-rolling ceremony.
=== FRAGMENT ITEMS ===
- Each fragment is a custom item (use a different base material or custom name/color per fragment) with a unique display name, lore describing its passive and active ability, and a PersistentDataContainer tag identifying its fragment type. Never rely on item names alone to identify fragments.
- Fragments cannot be destroyed: invulnerable to fire, lava, cactus, explosions, and the void (respawn the item at world spawn if it falls into the void), and they never despawn.
- Fragments cannot be placed into ender chests, shulker boxes, or bundles (configurable). They can go in normal chests.
- Fragments are dropped on death regardless of the keepInventory setting.
- Rules for using fragments:
- PASSIVE ability: active only while that fragment is in the player's OFFHAND. - ACTIVE ability: triggered by right-clicking while holding that fragment in the MAIN HAND. - Each fragment type has its own cooldown per player, shown on the action bar (for example "Gale Surge: 14s") and with a sound when it becomes ready.
- On death, a player's fragments drop at their death location. The killer can pick them up. After respawning, the victim receives a new random fragment after a configurable delay (default 10 minutes). The delay is skipped if they have no fragment.
- Duplicates are allowed, since many players share a small number of types. A player may carry multiple fragments but only the offhand fragment gives its passive.
=== THE 10 FRAGMENTS === Each has a passive (offhand) and an active (right-click) with a cooldown. All numbers should be configurable.
- GALE FRAGMENT
Active "Skyward Surge": the player flies freely for 2 seconds, then gets Slow Falling for 4 seconds. Cooldown 45s.
Passive: no fall damage.
- VITAL FRAGMENT
Active "Surge of Life": instantly heals 8 hearts and gives Regeneration II for 5 seconds. Cooldown 60s.
Passive: slow natural regeneration when below 30% health.
- BLINK FRAGMENT
Active "Blink": teleports the player up to 14 blocks toward where they are looking (stops at walls, never inside blocks), with a particle trail and sound at both ends. Cooldown 25s.
Passive: immune to damage from ender pearls and chorus fruit.
- SHADOW FRAGMENT
Active "Veil": the player becomes fully invisible for 8 seconds, including armor and held items, with no particles. Breaking invisibility early by attacking or taking damage starts a 15-second cooldown immediately. Cooldown 50s.
Passive: Night Vision while standing in low light.
- GRAVITY FRAGMENT
Active "Gravity Well": pulls all players within 8 blocks toward the user and applies Slowness II for 3 seconds. Cooldown 40s.
Passive: 25% less knockback.
- FROST FRAGMENT
Active "Deep Freeze": freezes all enemies within 6 blocks in place for 2 seconds (cannot move, but can still turn their camera) and applies the freezing screen effect. Cooldown 55s.
Passive: immune to powder snow and Slowness effects.
- CHRONO FRAGMENT
Active "Rewind": returns the player to the exact position and health they had 6 seconds earlier. Store a short rolling history of position and health. Cooldown 90s.
Passive: a brief burst of Speed I for 3 seconds after taking damage (internal cooldown 15s).
- THUNDER FRAGMENT
Active "Smite": strikes lightning on the player or entity the user is aiming at, within 25 blocks, dealing extra damage. Cooldown 45s.
Passive: immune to lightning and fire damage from lightning.
- MIRROR FRAGMENT
Active "Reflection": for 4 seconds, 50% of melee damage taken is reflected to the attacker and arrows or tridents that hit the user are sent back at the shooter. Cooldown 60s.
Passive: small chance (15%) to completely negate a projectile.
- ECHO FRAGMENT
Active "Decoy": spawns a decoy copy of the user (an armor stand or NPC with the same skin and armor) that runs in the direction the user is facing and disappears after 6 seconds or when hit, while the user turns invisible for 2 seconds. Cooldown 50s.
Passive: players using any fragment ability within 20 blocks briefly show a glowing outline to you.
=== THE DEATH GEM ===
- Only ONE Death Gem can exist on the server at any time.
- Crafting: a player holding at least one of every one of the 10 fragment types in their inventory can open the Death Forge with the command /deathgem forge (or by sneak-right-clicking a crafting table, configurable). The forge consumes one of each fragment type and creates the Death Gem. A dramatic server-wide announcement plays (title, sound, chat message naming the player).
- The Death Gem has the same item protections as fragments, cannot be put in any container, and drops on death. Its location is announced to everyone each time it changes hands (configurable).
- If the holder dies, it drops at the death location and a particle beam is visible to all players nearby, so it can be hunted.
- The Death Gem has its own cooldowns for each ability, and the same offhand / main-hand rules as fragments.
Death Gem abilities (overpowered on purpose):
- PASSIVE: +4 max hearts, Strength I, Speed I, no fall damage, and Fire Resistance.
- ACTIVE 1, "Reaper's Dash" (right-click): dashes 12 blocks forward, damages every entity in the path, and grants 1 second of invulnerability. Cooldown 20s.
- ACTIVE 2, "Death's Mark" (sneak + right-click on a player in view, 30 blocks): marks them for 10 seconds. The marked player glows for the user, takes 25% more damage from the user, and cannot use any fragment ability. Cooldown 60s.
- ACTIVE 3, "Deathfield" (swap-hands key while sneaking): creates a 15-block-radius dark zone for 10 seconds. Enemies inside get Slowness II, Weakness II, and Wither I, while the user gets Speed II and Regeneration II. Cooldown 120s.
- AUTO, "Last Breath": the first time the holder would die, they instead heal to 50% health, release a knockback shockwave, and become invulnerable for 3 seconds. Cooldown 10 minutes (time shown in action bar).
=== ADMIN MANAGEMENT MENU === Command: /fragmentadmin (permission: fragmentsmp.admin). Opens a chest-style GUI with clearly labeled buttons:
- START / STOP SMP: a toggle button that shows the current state. When turned ON, it begins the Rolling Ceremony (see below). When turned OFF, it stops the ceremony and freezes fragment use, with a confirmation prompt.
- PLAYERS: a paginated list of player heads. Clicking one opens a submenu to give, set, reroll, or remove their fragment, and to see their cooldowns.
- FRAGMENTS: toggle each fragment type on or off globally, and edit its cooldown.
- DEATH GEM: shows whether it exists and who holds it, with buttons to delete it, give it to a player, or teleport to it.
- SETTINGS: toggle duplicates, drop-on-death rules, respawn delay, ability use in safe zones, and other major config values.
- RELOAD CONFIG.
Also provide matching commands (/fragmentadmin give, set, reroll, reload, start, stop) and permission nodes.
=== ROLLING CEREMONY (START OF THE SMP) === When the admin turns the SMP ON, for all online players at the same time:
- Each player slowly floats up about 5 blocks from where they are standing, while a title says "The SMP Begins...". They are held in place and cannot move, attack, or take damage. Players who join later go through the same ceremony on their first join.
- A rolling-screen GUI opens for each player: a slot-machine row where fragment icons scroll past, slowing down over about 6 seconds, with a tick sound for each step, and finally landing on the player's result, which is chosen randomly. Players cannot close the GUI during the roll.
- The result is revealed with a title, a sound, a particle burst, and the fragment name colored in its theme color. Optionally broadcast the result in chat (configurable).
- The player receives the fragment item, is bound to it, and then slowly lowers back to the ground with no fall damage and control returned.
All timing, height, sounds, and messages must be configurable.
=== TECHNICAL REQUIREMENTS ===
- Store player data (fragments, cooldowns, ceremony state, Death Gem location and holder) persistently, so it survives restarts.
- Handle edge cases: players logging out during the ceremony, server restarts, items being dropped in odd ways, and players dying while holding multiple fragments.
- Use PersistentDataContainer for item identification, and prevent duplication exploits (inventory click tricks, drops while changing worlds, etc.).
- All text must support color codes and be editable in a messages section of the config.
- Provide a README section at the end that lists commands, permissions, and a brief guide to editing balance values.
I’ve started building FragmentSMP as a new Paper plugin, including its configuration, admin tools, persistence, and README.
Build persistent fragment, cooldown, ceremony, and Death Gem systems.
Add abilities, protections, commands, and the admin GUI.
Document configuration and practical visual limitations.Created the FragmentSMP project with fragment abilities, persistent cooldowns, ceremonies, commands, and an admin menu.
It is not yet complete or production-ready. Strict Death Gem uniqueness, some abilities and protections, and several admin controls remain unfinished. The README lists the known limitations.
The initial build compiled, but several requested features were unfinished. I’ve started a follow-up to complete the abilities, protections, ceremony, and admin controls.
Harden Death Gem handling and complete core ability lifecycles.
Improve ceremony recovery and admin controls.
Update configuration and document remaining limitations.Implemented several improvements, including the Death Gem health bonus, incremental ceremony descent and recovery, fragment admin controls, item name/lore configuration, and hopper restrictions.
The plugin is still incomplete. The README identifies remaining gaps, including equipment-hiding invisibility, viewer-specific glow, singleton enforcement, inventory loopholes, and admin controls. No build or tests were run.
FragmentSMP compiles successfully, but it is not complete or production-ready. Remaining gaps include Death Gem tracking and anti-duplication, some inventory restrictions and immunities, and admin controls. The README lists the known limitations.
The follow-up did not resolve all of these gaps. Would you like me to prioritize Death Gem security and item protections next?
The FragmentSMP plugin compiles, but fragment abilities do nothing and there are multiple bugs. Do a full debugging pass before adding anything new.
- Read all existing source files and list every listener, command, and ability, then verify each one is registered in onEnable and in plugin.yml.
- Verify fragment items are created and identified with the same PersistentDataContainer key everywhere (creation, right-click detection, offhand check, drop and pickup handling).
- Fix the right-click handler: handle PlayerInteractEvent for main hand only (check event.getHand() == EquipmentSlot.HAND), accept RIGHT_CLICK_AIR and RIGHT_CLICK_BLOCK, and do not cancel or ignore the event because of other conditions. Make sure the check for "SMP started" and "fragment enabled" can't permanently block abilities.
- Test every one of the 10 fragment actives, every passive, and the Death Gem abilities by tracing the code path from click to effect, and fix anything that cannot work.
- Add debug logging controlled by a "debug: true" option in config.yml that prints when an ability is triggered, blocked (and why), or put on cooldown.
- Report exactly what you fixed and anything still not working.
Known symptoms: nothing happens when right clicking a gem, no description on how to use them and they just dont work Console errors: none
I found one likely cause: the right-click listener ignores cancelled events, including events Bukkit may pre-cancel for right-clicking air. I’ve started a full code-path audit and will report the fixes and any remaining gaps.
…1. Fix interaction, state checks, cooldowns, and passive paths. 2. Add configurable usage lore and debug diagnostics. 3. Document the static audit and remaining limitations.Fixed main-hand right-click activation, including pre-cancelled air clicks; added configurable blocked reasons, usage lore, and debug logging. Also fixed Shadow’s early-break cooldown notification and prevented movement locks from blocking teleports.
Audited listener and command registration and documented each ability’s code path in the README. The plugin still has known gaps, including equipment hiding, viewer-specific glow, some immunities, inventory restrictions, and ready notifications after restart or while offline. The README lists them in detail.
This was a static audit only; no build, tests, or gameplay verification were performed.
Debugging report
The updated plugin compiles successfully. The audit was a static code trace, not an in-game test, so gameplay still needs verification.
Fixed
Main-hand air and block right-clicks now reach the ability handler even when Bukkit has pre-cancelled the event—a likely cause of the reported symptom.
Added configurable feedback for blocked abilities and
debug: truelogging for triggers, block reasons, and cooldown starts.Added configurable usage lore. Existing tagged items without lore receive it without replacing their PDC data.
Fixed Shadow’s early-break cooldown notification and movement locks interfering with teleports.
Checked that item creation and recognition use the same
fragmentPDC key; Death Gems additionally require the persistedgem-id.
Note: Recognized fragment interactions now also bypass cancellations from other plugins, as requested.
Registration and ability audit
onEnable registers all three listeners: GameListener (interaction, combat, movement, death and item/inventory handling), Ceremony (movement, GUI, join and quit), and Admin (GUI clicks and drags). It registers both command executors; plugin.yml declares /fragmentadmin and /deathgem and their permissions.
The README now traces all ten active/passive pairs: Gale, Vital, Blink, Shadow, Gravity, Frost, Chrono, Thunder, Mirror and Echo, plus Death Gem Dash, Mark, Deathfield, Last Breath and offhand bonuses.
Still not working as specified
Shadow and Echo invisibility does not hide equipment; Echo and Mark glow is visible to everyone.
Blink lacks chorus immunity; Thunder targets players only and lacks lightning-caused fire immunity.
Gravity scales general velocity, not just knockback. Blink destination safety is incomplete.
Death Gem singleton tracking and container protections have known loopholes; the plugin is not production-ready for strict item security.
Ready sounds are not restored after restart or delivered while a player is offline. Some timed effects can persist after stopping the SMP or entering a safe zone.
For diagnostics, set debug: true in config.yml, then run /fragmentadmin reload. Use /fragmentadmin start to enable abilities; the full audit and limitations are in the README.
at the moment, it has a lot of bugs, such as the one i asked you to fix, but u didnt do that. complete the plugin and fix the bugs. i cant even open the admin menu rn
I’m sorry—the earlier fix didn’t resolve it. I found one likely admin-menu problem: the rolling ceremony can reopen its GUI over the menu.
I’ve started a broader repair pass, prioritizing the admin menu and usable abilities before the remaining features.
…Fixed the most likely causes of the reported symptoms:
Admin menu: ceremony inventory reopening could replace
/fragmentadminon the next tick. Admin menus now temporarily override the roll, navigation is deferred safely, and the ceremony resumes afterward if still active. Permission denial and SMP status are visible.Abilities: main-hand tagged items are checked before crafting-table forging; attempts during ceremonies now explain why they are blocked. Potion effects use Paper’s namespaced registry, and Thunder can target living entities.
Recovery and data: interrupted ceremonies recover for players already online at startup. Existing PDC identifiers remain intact; type recognition also accepts older mixed-case values. Ground gem locations are persisted.
Admin controls: added gem reissue to the administrator, invalidating the previous gem ID, and feedback when its location is unknown.
Updated the README with troubleshooting and the static audit.
Remaining gaps: equipment-hiding invisibility and viewer-only glow are not implemented; Blink chorus immunity and lightning-caused fire immunity remain missing. Inventory and singleton protection are incomplete, particularly for nested or unloaded items and cloned NBT. The admin menu still lacks player-targeted gem giving, safe-zone editing and some settings. Some timed effects and cooldown notifications also have lifecycle limitations described in the README.
These fixes are based on source inspection only. No build, tests or in-game verification were run.
The admin-menu repair compiles, but the plugin still has significant gaps. I’ve started another focused pass on the remaining gameplay bugs, item protections, and admin controls.
No files in this session