Create a complete, stable and production-ready Paper Minecraft plugin named:
Plugin Name: "Sword_Smp" Author: "itz_miikey" Target: Paper 1.21.x / Minecraft 1.21.x Permission: "swordsmp.admin"
This plugin is designed for a scripted SMP / YouTube video series, so the mechanics should be reliable, cinematic and highly configurable.
---
- CORE SWORD SYSTEM
When a player joins the server for the first time, they receive one special:
Wooden Sword
The special sword must:
- Be unbreakable.
- Never lose durability.
- Be permanently associated with its owner.
- Be identified using "PersistentDataContainer" / "NamespacedKey".
- Not depend only on its display name or lore for identification.
- Not be craftable.
- Not be permanently lost after death.
- Not be droppable.
- Not be picked up or used by another player.
- Not be duplicated.
The player's special sword should automatically be restored if necessary.
---
- DIAMOND SWORD UNLOCK
Initially every player has the special Wooden Sword.
After a configurable number of real-world days from the player's first join, their Wooden Sword automatically becomes a special Diamond Sword.
Config:
sword-system: diamond-unlock-days: 7
The first-join timestamp must be saved permanently.
The timer must survive:
- Server restart
- Plugin reload
- Player logout/login
When the Diamond Sword unlocks, the player's current Sharpness level must remain the same.
Example:
Wooden Sword Sharpness VII ↓ Diamond Sword unlocked ↓ Diamond Sword Sharpness VII
---
- SHARPNESS PROGRESSION
The special sword has Sharpness levels:
Sharpness I Sharpness II Sharpness III Sharpness IV Sharpness V Sharpness VI Sharpness VII Sharpness VIII Sharpness IX Sharpness X
Maximum = Sharpness X.
The progression must work on both Wooden Sword and Diamond Sword.
The player does NOT need to unlock the Diamond Sword before Sharpness can increase.
---
- KILLS REQUIRED FOR SHARPNESS
Use this exact progression:
Sharpness I → II = 1 kill Sharpness II → III = 2 kills Sharpness III → IV = 2 kills Sharpness IV → V = 2 kills
Sharpness V → VI = 3 kills Sharpness VI → VII = 3 kills Sharpness VII → VIII = 3 kills Sharpness VIII → IX = 3 kills Sharpness IX → X = 3 kills
The kill progress must be saved permanently.
When the player gets a kill using their special sword:
- Increase kill progress.
- When enough kills are reached, increase Sharpness.
- Reset kill progress for the next Sharpness level.
---
- VERY IMPORTANT — REAL SHARPNESS DAMAGE
This is extremely important.
Do NOT simply rename or display Sharpness V as Sharpness VI, VII, VIII, IX or X.
Minecraft normally limits the Sharpness enchantment to level V.
Therefore:
Sharpness VI–X must have REAL additional damage.
The plugin should use a proper Paper/Bukkit damage event or equivalent custom damage system.
Example concept:
Sharpness V = vanilla Sharpness V damage Sharpness VI = Sharpness V + configured extra damage Sharpness VII = Sharpness V + more extra damage ...
Sharpness X = highest damage
The exact additional damage should be configurable:
sharpness-system: starting-level: 1 maximum-level: 10
extra-damage: enabled: true damage-per-level-above-v: 0.5
For example:
Level VI = +0.5 damage Level VII = +1.0 damage Level VIII = +1.5 damage Level IX = +2.0 damage Level X = +2.5 damage
The implementation must:
- Actually increase damage.
- Not double-apply damage.
- Work with Wooden and Diamond swords.
- Work consistently against players and normal damageable entities where appropriate.
- Not create infinite/recursive damage events.
- Not rely on fake enchantment levels that Minecraft ignores.
The displayed Sharpness level can be stored/displayed through the sword's metadata/lore, while the actual bonus damage is handled by the plugin.
---
- WOODEN SWORD SHARPNESS
Sharpness progression must work even while the player has a Wooden Sword.
Example:
Wooden Sword Sharpness I ↓ Kills ↓ Wooden Sword Sharpness II ↓ ... ↓ Wooden Sword Sharpness X
When the Diamond Sword unlocks, preserve the current Sharpness.
Example:
Wooden Sword Sharpness VIII ↓ Diamond Sword unlocked ↓ Diamond Sword Sharpness VIII
---
- DEATH SHARPNESS RESET
When a player dies:
Sharpness I–IV
Keep their current Sharpness level.
Sharpness V or higher
Reset their Sharpness to:
Sharpness I
Make this configurable:
sharpness-system: death-reset: enabled: true reset-at-level: 5 reset-to-level: 1
Kill progress should also reset appropriately when Sharpness resets.
The sword itself must be restored after respawn.
---
- SHARPNESS X EVENT
When a player reaches Sharpness X for the first time:
Trigger a dramatic server-wide event.
The event should:
- Start a thunderstorm.
- Play the Warden emergence sound for all online players.
- Broadcast a Sebastian message.
- Only trigger once for that achievement unless the relevant state is intentionally reset.
Config:
sharpness-x-event: enabled: true
thunderstorm: true
sound: enabled: true sound: "ENTITY_WARDEN_EMERGE" volume: 10.0 pitch: 0.55
strongest-player-message: "&4&l[SEBASTIAN] &c%player% has become &4&lTHE STRONGEST ONE&c!"
Do not repeatedly play the sound every tick.
Do not replay it automatically every time the server restarts.
---
- SEBASTIAN LORE SYSTEM
Use SEBASTIAN instead of "[SERVER]".
Sebastian is a mysterious servant/harbinger connected to Satan in the SMP story.
Example:
[SEBASTIAN] Mikey has become THE STRONGEST ONE.
The prefix must be configurable:
messages: prefix: "&4&l[SEBASTIAN]"
Do not hard-code "[SERVER]".
All important story messages should use the configurable Sebastian prefix where appropriate.
---
- SHARPNESS X DEATH EVENT
If a player reaches Sharpness X and then dies, trigger a special dramatic event.
The event should:
- Start a thunderstorm.
- Broadcast configurable Sebastian/Devil dialogue.
- Reset the player's Sharpness according to the death-reset settings.
- Restore the correct sword after respawn.
Example configuration:
sharpness-x-death-event: enabled: true
thunderstorm: true
messages: - "&4&l[SEBASTIAN] &cYou were not worthy..." - "&4&l[SEBASTIAN] &cYour power has been taken from you."
All messages must be configurable.
---
- LIFE SYSTEM
Every player starts with:
10 Lives
The number of starting/max lives must be configurable.
life-system: enabled: true starting-lives: 10 max-lives: 10
When Player 1 kills Player 2:
Player 1: +1 Life Player 2: -1 Life
Example:
Player 1 = 10 lives Player 2 = 10 lives
Player 1 kills Player 2
Player 1 = 10 lives Player 2 = 9 lives
If the killer is already at the maximum number of lives, do not exceed "max-lives".
Example:
Player 1 = 10/10 Player 2 = 9/10
Player 1 kills Player 2
Player 1 = 10/10 Player 2 = 8/10
The victim still loses a life.
Never allow lives to become negative.
---
- LIFE DATA STORAGE
Save lives permanently.
Lives must survive:
- Server restart
- Plugin reload
- Logout/login
- Death
Store at least:
UUID Lives First Join Time Diamond Unlock State Sharpness Kill Progress Sharpness X announcement state
Use reliable persistent storage such as YAML/JSON.
---
- ZERO-LIFE BEHAVIOR
When a player reaches 0 lives, make the behavior configurable.
life-system: zero-lives: action: "NONE"
Possible actions:
NONE SPECTATOR BAN
Default:
NONE
Do not automatically ban players unless configured.
---
- LIFE MESSAGES
Make life messages configurable:
life-system: messages: killer-gained-life: "&a%killer% gained 1 life!" victim-lost-life: "&c%victim% lost 1 life!" zero-lives: "&4&l%player% has no lives remaining!"
Support placeholders:
%killer% %victim% %lives%
---
- FEAR EVENT
Create a Fear Event system.
The Fear Event should be triggered through:
SHIFT + RIGHT CLICK
The player must:
- Hold the special Sword.
- Sneak / hold Shift.
- Right-click.
- Be looking at another player.
- The target player must be within the configured Fear range.
- The Fear Event triggers on that target.
Use standard Paper/Bukkit interaction events:
- Detect right-click.
- Check "Player#isSneaking()".
- Check that the player is holding their special Sword.
- Determine the player being targeted using an appropriate ray trace / target detection method.
- Check distance.
Do NOT require a client-side mod.
The physical input should effectively behave as:
SHIFT + RIGHT CLICK + Holding Special Sword + Looking at another player + Target within Fear Range = FEAR EVENT
---
- FEAR RANGE CONFIGURATION
The Fear range must be configurable.
Example:
fear-event: enabled: true
range: 30
cooldown: 60
I should be able to change:
30 blocks 40 blocks 50 blocks 100 blocks
without changing the Java code.
---
- FEAR COOLDOWN
The Fear Event must have a configurable cooldown.
fear-event: cooldown: 60
The cooldown is in seconds.
During cooldown, the event must not trigger again.
Also implement a small internal debounce so one physical right-click cannot accidentally trigger the event multiple times.
---
- FEAR MESSAGES
Config:
fear-event: messages: - "&4&l[SEBASTIAN] &cThe Descendant of Satan is watching you..." - "&4&l[SEBASTIAN] &cRUN..."
Support placeholders:
%target% %source%
The event should be cinematic and suitable for a scripted SMP.
---
- FEAR COMMANDS
Add:
/swordsmp fear <player>
This manually triggers the Fear Event on the specified player.
Also add:
/swordsmp fear
When used by a player:
- Find the nearest player within the configured Fear range.
- Trigger the Fear Event on that player.
- Respect cooldown unless the command is an admin override.
Permission:
swordsmp.admin
---
- FORCE SHARPNESS COMMAND
Add:
/swordsmp forcelevel <player> <1-10>
This allows an admin to directly set a player's Sharpness.
It must:
- Set Sharpness immediately.
- Reset kill progress to 0.
- Refresh the player's special sword.
- Preserve whether the player currently has Wooden or Diamond Sword.
- Allow levels 1–10.
Also add alias:
/swordsmp sharpness <player> <1-10>
---
- DIAMOND SWORD UNLOCK COMMAND
Add:
/swordsmp unlockdiamond
This unlocks the Diamond Sword for all online players.
It must:
- Immediately replace each player's Wooden Sword with Diamond Sword.
- Preserve their current Sharpness.
- Preserve their lives.
- Save the new state.
- Not reset unrelated player data.
After unlocking, display a large screen title to every online player.
Example:
DIAMOND SWORD IS UNLOCKED
The title must be red.
Config:
diamond-unlock-event: enabled: true
title: "&c&lDIAMOND SWORD" subtitle: "&c&lIS UNLOCKED"
fade-in: 10 stay: 60 fade-out: 20
Also send a configurable Sebastian announcement.
---
- LOCK DIAMOND SWORD / RETURN TO WOODEN
Add:
/swordsmp woodenall
This locks the Diamond Sword again for all online players.
Every online player immediately receives their special Wooden Sword.
IMPORTANT:
Their Sharpness must NOT reset.
Example:
Diamond Sword Sharpness VII ↓ /swordsmp woodenall ↓ Wooden Sword Sharpness VII
Lives must also remain unchanged.
Add aliases:
/swordsmp wooden /swordsmp setwooden
This command is useful for scripted episodes.
---
- GIVE COMMAND
Keep:
/swordsmp give <player>
Give the player their correct special sword.
Do not create duplicate special swords.
---
- RESET COMMAND
Keep:
/swordsmp reset <player>
This should reset the player's sword progression according to the plugin's reset design.
Make sure the command does not accidentally reset lives unless explicitly intended.
---
- INFO COMMAND
Keep:
/swordsmp info <player>
Display:
Player Lives Sword Type Sharpness Kill Progress Kills Required Diamond Sword Status Diamond Unlock Time
Example:
Player: Mikey Lives: 10/10 Sword: Wooden Sword Sharpness: VII Kill Progress: 1/3 Diamond Sword: Locked
---
- SET DAYS COMMAND
Keep:
/swordsmp setdays <days>
Allow an admin to change the configured Diamond Sword unlock time.
---
- RELOAD COMMAND
Keep:
/swordsmp reload
Reload configuration safely.
Do not reset player data when reloading.
---
- ALL SWORD CRAFTING MUST BE BLOCKED
Completely prevent crafting of all sword types.
This includes:
- Wooden Sword
- Stone Sword
- Iron Sword
- Golden Sword
- Diamond Sword
- Netherite Sword
- Copper Sword
No player should be able to craft any sword from a crafting table.
The plugin should listen for crafting events and prevent these recipes.
The special Sword SMP swords must also never be craftable.
---
- SWORD DUPLICATION / SECURITY
Prevent players from duplicating special swords through:
- Crafting
- Dropping
- Death
- Inventory manipulation
- Item movement exploits
- Containers where appropriate
- Plugins attempting to duplicate the sword
The owner UUID should be stored in the sword's PersistentDataContainer.
Example internal data:
swordsmp:special_sword = true swordsmp:owner_uuid = <UUID>
---
- DEATH / RESPAWN
When a player dies:
- Their special sword must not remain as a dropped item.
- Remove dropped copies if necessary.
- Restore the correct sword after respawn.
- Preserve their life data.
- Preserve or reset Sharpness according to the configured death rules.
- Prevent duplication.
---
- CONFIG.YML
The configuration should be organized clearly.
At the very top:
Author: itz_miikey
Use separate sections:
Author: itz_miikey
life-system:
sword-system:
sharpness-system:
sharpness-x-event:
sharpness-x-death-event:
diamond-unlock-event:
fear-event:
messages:
All important values should be configurable.
---
- COMPLETE COMMAND LIST
The final plugin should support:
/swordsmp reload
/swordsmp give <player>
/swordsmp reset <player>
/swordsmp info <player>
/swordsmp setdays <days>
/swordsmp forcelevel <player> <1-10>
/swordsmp sharpness <player> <1-10>
/swordsmp unlockdiamond
/swordsmp woodenall /swordsmp wooden /swordsmp setwooden
/swordsmp fear <player> /swordsmp fear
All administrative commands require:
swordsmp.admin
Default permission should be OP.
---
- TAB COMPLETION
Add proper tab completion for all commands where possible.
For example:
/swordsmp forcelevel <player> <1-10> /swordsmp sharpness <player> <1-10> /swordsmp give <player> /swordsmp reset <player> /swordsmp info <player>
Show online player names as suggestions.
---
- ERROR HANDLING
Commands should provide useful messages for:
- Unknown player
- Invalid Sharpness level
- Invalid number of days
- No player in Fear range
- Fear Event cooldown active
- Player not holding special sword
- No valid target
Do not throw unnecessary console errors.
---
- PERFORMANCE
The plugin should be optimized.
Avoid unnecessary repeating tasks.
Do NOT constantly scan every player's inventory every tick.
Use Bukkit/Paper events wherever possible.
Fear detection should only run when the player actually performs the interaction.
Sharpness X sound/event detection should not run unnecessarily every tick.
---
- IMPORTANT COMPATIBILITY REQUIREMENT
Target:
Paper 1.21.x
Use the appropriate Paper API for the selected Minecraft version.
Do not use deprecated or incompatible APIs where avoidable.
Before finalizing:
- Compile the complete project.
- Make sure there are no compilation errors.
- Make sure "plugin.yml" is correct.
- Make sure "config.yml" is valid YAML.
- Make sure all commands are registered.
- Make sure the permission is registered.
- Make sure all Java classes are included.
- Provide the compiled ".jar".
---
- FINAL IMPORTANT REQUIREMENT
Do NOT simplify or remove any of the mechanics above.
In particular, do NOT make these mistakes:
❌ Sharpness VI–X being only renamed Sharpness V ❌ Wooden Sword not gaining Sharpness ❌ Losing Sharpness when switching to Diamond Sword ❌ Fear Event working outside configured range ❌ Shift + Right Click triggering multiple times from one interaction ❌ Fear cooldown not working ❌ Lives resetting after restart ❌ Diamond unlock resetting Sharpness ❌ "/woodenall" resetting Sharpness or lives ❌ Special swords being craftable ❌ Copper Sword crafting being allowed ❌ Special sword duplication ❌ Repeated Sharpness X sound spam ❌ Data being lost after server restart
The final result should be a single complete "Sword_Smp" Paper plugin ready to place in the server's "plugins" folder.
Provide the complete source code and compiled JAR if compilation is available.
Create the Paper/Gradle project, plugin descriptor, and complete configurable defaults.
Implement persistent player data, protected owner-bound swords, unlocks, sharpness damage/progression, lives, death handling, and crafting security.
Add Fear interactions, administrative command suite with completions, and event listeners.
Created the complete Sword_Smp Paper 1.21.x plugin source project:
Gradle Paper project targeting Java 21 / Paper 1.21.x.
Persistent YAML player data for lives, first join, diamond state, Sharpness progress, and Sharpness-X announcement state.
Owner-bound, unbreakable PDC special swords with death restoration and anti-drop/pickup/container protections.
Wooden → Diamond timed progression, real Sharpness VI–X bonus damage, death reset mechanics, cinematic Sharpness-X events, and life system.
Fear interaction system with ray tracing, configurable range/cooldown/debounce, commands, permissions, tab completion, crafting blocks, and configurable Sebastian messaging.
plugin.ymland organizedconfig.ymlincluded.
A compiled JAR was not produced because build tooling is unavailable in this environment. Build with:
./gradlew build
The JAR will be located at:
build/libs/Sword_Smp-1.0.0.jar
LIFE ELIMINATION & REVIVAL SYSTEM
Modify the existing Life System with the following mechanics.
- PLAYER ELIMINATION AT 0 LIVES
When a player's lives reach 0, that player must be eliminated.
The player should no longer be able to normally play after elimination.
Do NOT simply leave the player at 0 lives with no consequence.
The elimination action must be configurable, but the default should be:
life-system: zero-lives: action: "ELIMINATE"
When the player is eliminated:
- Their lives become 0.
- Mark the player as permanently eliminated in saved player data.
- Prevent normal gameplay while eliminated.
- Give the eliminated player exactly ONE Revival Paper.
- The Revival Paper must be specifically linked to that eliminated player.
- Do not give multiple Revival Papers accidentally through reconnects, restarts or respawns.
The Revival Paper should have a configurable display name, for example:
revival: paper-name: "&c&lREVIVAL PAPER"
---
- REVIVAL PAPER
When a player is eliminated, give them one special Paper item.
The Paper must be identifiable using PersistentDataContainer / NamespacedKey.
Do NOT identify the Revival Paper only by its name or lore.
Example internal data:
swordsmp:revival_paper = true swordsmp:eliminated_player = <UUID>
The Revival Paper should not be craftable.
It should not be possible to duplicate it.
---
- RIGHT-CLICK REVIVAL PAPER
When the eliminated player right-clicks the special Revival Paper:
Open a custom GUI menu, similar to a shop-style inventory menu.
The GUI should display players who can be revived.
Use player heads as the selectable items.
For every player head:
- The head represents a player.
- Hovering over the head should show the player's name in the item tooltip/lore.
- Clicking the head selects that player.
- After clicking a player head, close the GUI.
Do NOT use a normal Minecraft shop plugin dependency. Implement the GUI directly inside this plugin.
---
- REVIVAL PLAYER SELECTION
The Revival GUI should only show players who are valid revival targets according to the plugin's rules.
At minimum:
- Do not show the eliminated player themselves.
- Do not show players who are already eliminated.
- Do not allow reviving an already active player.
- Do not allow invalid/offline targets unless the system is specifically designed to support offline revival.
Make the rules configurable where practical.
Example GUI:
+--------------------------------+ | REVIVAL | | | | [Player Head] | | PlayerName | | | | [Player Head] | | AnotherPlayer | | | +--------------------------------+
The GUI should have a configurable title:
revival: gui: title: "&4&lREVIVE A PLAYER"
---
- REVIVAL LIFE COST
Reviving another player must cost the player who is performing the revival a configurable number of lives.
Add a dedicated configuration section:
revival: life-cost: 2
This means:
If Player A revives Player B:
Player A loses 2 lives Player B becomes alive again
The number must be configurable.
For example:
life-cost: 1
or:
life-cost: 3
The plugin must NEVER hard-code the value 2.
---
- REVIVAL CONFIRMATION
After the player clicks another player's head, close the GUI.
Then send a confirmation message in chat.
Example:
Reviving PlayerName will cost you 2 lives.
Are you sure you want to revive this player?
Type YES to confirm.
Type NO to cancel.
The exact number must use the configured "revival.life-cost".
Example if cost is 2:
Reviving PlayerName will cost you 2 lives.
Are you sure you want to revive this player?
Type YES to confirm.
Type NO to cancel.
The player must type:
yes
to confirm.
Or:
no
to cancel.
The input should be case-insensitive:
yes YES Yes
should all work.
Likewise:
no NO No
should all work.
---
- CONFIRMATION TIMEOUT
The confirmation should expire after a configurable amount of time.
Add:
revival: confirmation-timeout: 30
The value is in seconds.
If the player does not type YES or NO before the timeout:
- Cancel the revival.
- Do not remove any lives.
- Send a configurable message saying the revival request expired.
---
- REVIVAL CONFIRMATION SAFETY
Before accepting "YES", verify again that:
- The target is still eliminated.
- The reviver is still alive.
- The reviver still has enough lives to pay the configured revival cost.
- The target can still be revived.
- The revival request has not expired.
If any condition fails:
- Cancel the revival.
- Do not remove lives.
- Do not revive anyone.
- Send an appropriate message.
This prevents exploits where the player's life count changes while the confirmation is waiting.
---
- REVIVAL EXECUTION
If the player types "YES" and all requirements are satisfied:
- Remove the configured number of lives from the reviver.
- Mark the target player as no longer eliminated.
- Give the revived player the configured number of starting/restore lives according to the revival configuration.
- Restore their normal gameplay.
- Restore their special SMP Sword.
- Save all player data immediately.
- Remove/invalidate the Revival Paper so it cannot be reused.
- Send a configurable revival message.
Add a configurable number of lives given to the revived player:
revival: life-cost: 2 revived-player-lives: 1
So by default:
Reviver: -2 lives Revived player: returns with 1 life
Do not automatically give the revived player 10 lives unless configured.
---
- REVIVAL PAPER AFTER USE
After a successful revival:
- The Revival Paper must be consumed/removed.
- It must become unusable.
- The player must not be able to duplicate it.
- Reconnecting to the server must not give another Revival Paper.
- Server restart must not give another Revival Paper.
If the revival is cancelled with "NO":
- Keep the Revival Paper.
- Do not remove lives.
- Do not revive anyone.
- Allow the player to use the paper again later.
---
- ELIMINATED PLAYER STATE
Store an "eliminated" boolean in player data.
Example:
eliminated = true
When eliminated:
Lives = 0 Eliminated = true
When successfully revived:
Lives = configured revived-player-lives Eliminated = false
This data must survive:
- Server restart
- Plugin reload
- Logout/login
---
- SCREEN / ACTIONBAR LIFE DISPLAY
The player's current lives must always be clearly visible above the hotbar, using the Minecraft Action Bar.
Example:
❤️ Lives: 10
If the player has 7 lives:
❤️ Lives: 7
If the player has 1 life:
❤️ Lives: 1
If eliminated:
☠ Lives: 0 — ELIMINATED
The Action Bar should update whenever the player's life count changes and should also remain visible during normal gameplay.
Do not spam the normal chat with the life count.
Make the Action Bar configurable:
life-system: actionbar: enabled: true format: "&c❤ Lives: &f%lives%" eliminated-format: "&4☠ Lives: 0 &c&l— ELIMINATED"
The "%lives%" placeholder must automatically display the player's current lives.
---
- LIFE CHANGE SCREEN TITLE
When a player kills another player and lives change, show the updated life count on screen.
For the victim:
-1 LIFE 9 LIVES REMAINING
For the killer:
+1 LIFE 10 LIVES
Make these configurable:
life-system: title: enabled: true
killer: title: "&a&l+1 LIFE" subtitle: "&fYou now have &a%lives% &fLIVES"
victim: title: "&c&l-1 LIFE" subtitle: "&fYou have &c%lives% &fLIVES remaining"
eliminated: title: "&4&l0 LIVES" subtitle: "&c&lYOU ARE ELIMINATED"
fade-in: 10 stay: 50 fade-out: 20
If the victim reaches 0 lives, show the elimination title instead.
---
- REVIVAL SCREEN TITLE
When a player is successfully revived, display a configurable title:
revival: title: enabled: true title: "&a&lREVIVED" subtitle: "&fYou have returned to the SMP!" fade-in: 10 stay: 50 fade-out: 20
The revived player's Action Bar should immediately update to their new life count.
---
- REVIVAL MESSAGES
Make all revival messages configurable:
revival: messages: paper-received: "&cYou have been eliminated. You received a Revival Paper." selected: "&eRevival selected for &f%target%&e." confirmation: "&cReviving &f%target% &cwill cost you &4%cost% &clives.\n&fType &aYES &fto confirm or &cNO &fto cancel." cancelled: "&cRevival cancelled." expired: "&cRevival request expired." not-enough-lives: "&cYou do not have enough lives to perform this revival." successful: "&a&l%target% has been revived!"
Support placeholders:
%target% %cost% %lives% %player%
---
- IMPORTANT LIFE SYSTEM RULES
The following rules must remain unchanged:
When Player A kills Player B:
Player A = +1 life Player B = -1 life
Maximum lives must remain configurable.
Never exceed maximum lives.
Never go below 0 lives.
If Player B reaches 0:
Player B = ELIMINATED
Player B then receives exactly one Revival Paper.
---
- REVIVAL CONFIGURATION
The final "config.yml" should contain a dedicated section similar to:
Author: itz_miikey
life-system: enabled: true starting-lives: 10 max-lives: 10
zero-lives: action: "ELIMINATE"
actionbar: enabled: true format: "&c❤ Lives: &f%lives%" eliminated-format: "&4☠ Lives: 0 &c&l— ELIMINATED"
title: enabled: true
killer: title: "&a&l+1 LIFE" subtitle: "&fYou now have &a%lives% &fLIVES"
victim: title: "&c&l-1 LIFE" subtitle: "&fYou have &c%lives% &fLIVES remaining"
eliminated: title: "&4&l0 LIVES" subtitle: "&c&lYOU ARE ELIMINATED"
fade-in: 10 stay: 50 fade-out: 20
revival: enabled: true
life-cost: 2
revived-player-lives: 1
confirmation-timeout: 30
paper-name: "&c&lREVIVAL PAPER"
gui: title: "&4&lREVIVE A PLAYER"
title: enabled: true title: "&a&lREVIVED" subtitle: "&fYou have returned to the SMP!" fade-in: 10 stay: 50 fade-out: 20
messages: paper-received: "&cYou have been eliminated. You received a Revival Paper." selected: "&eRevival selected for &f%target%&e." confirmation: "&cReviving &f%target% &cwill cost you &4%cost% &clives.\n&fType &aYES &fto confirm or &cNO &fto cancel." cancelled: "&cRevival cancelled." expired: "&cRevival request expired." not-enough-lives: "&cYou do not have enough lives to perform this revival." successful: "&a&l%target% has been revived!"
---
- FINAL IMPORTANT REQUIREMENTS
Make sure the implementation does NOT have these problems:
❌ Player reaches 0 lives but can continue playing normally ❌ Player gets multiple Revival Papers ❌ Revival Paper duplicates after restart/reconnect ❌ Player can revive themselves ❌ Player can revive someone who is not eliminated ❌ Player can revive someone twice ❌ Revival removes lives before the player confirms YES ❌ Typing NO removes lives ❌ Expired confirmation removes lives ❌ Player can confirm after timeout ❌ Player can revive without enough lives ❌ Life count is not saved ❌ Life count disappears after restart ❌ Action Bar does not update after life changes ❌ Revival does not restore the player's SMP Sword ❌ Revival gives incorrect number of lives ❌ GUI remains open after selecting a player ❌ One click triggers multiple revival requests
Test the complete elimination → Revival Paper → GUI → player selection → confirmation → life deduction → revival process before finalizing the plugin.
Persist elimination state and add the default elimination/revival configuration.
Enforce eliminated gameplay restrictions, life titles/action bar, and exactly-once paper issuance.
Add the PDC-tagged paper GUI, confirmation workflow, validation, and revival restoration.
Implemented the elimination and revival system.
Persistent
eliminatedand Revival Paper issuance state inplayers.yml.Zero lives now defaults to
ELIMINATE, removes the SMP sword, enforces spectator/restricted gameplay, and issues one PDC-linked Revival Paper.Added revival GUI using player heads, chat YES/NO confirmation, configurable timeout/cost/restored lives, and revalidation before execution.
Successful revivals consume the linked paper, restore survival, sword, configured lives, action bar, and title.
Added configurable action bars, life-change titles, revival title, and all requested revival messages/configuration.
Eliminated players remain restricted across respawns, reconnects, and restarts without receiving duplicate papers.
package com.itzmiikey.swordsmp;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Objects;
public final class SwordSmpPlugin extends JavaPlugin {
private PlayerDataManager dataManager;
private SwordManager swordManager;
private FearManager fearManager;
private RevivalManager revivalManager;
@Override
public void onEnable() {
saveDefaultConfig();
dataManager = new PlayerDataManager(this);
dataManager.load();
swordManager = new SwordManager(this, dataManager);
fearManager = new FearManager(this, swordManager);
revivalManager = new RevivalManager(this);
SwordListener listener = new SwordListener(this);
Bukkit.getPluginManager().registerEvents(listener, this);
Bukkit.getPluginManager().registerEvents(revivalManager, this);
SwordSmpCommand command = new SwordSmpCommand(this);
Objects.requireNonNull(getCommand("swordsmp"), "swordsmp command missing from plugin.yml").setExecutor(command);
Objects.requireNonNull(getCommand("swordsmp"), "swordsmp command missing from plugin.yml").setTabCompleter(command);
for (Player player : Bukkit.getOnlinePlayers()) {
dataManager.getOrCreate(player.getUniqueId());
revivalManager.enforcePlayerState(player);
}
Bukkit.getScheduler().runTaskTimer(this, swordManager::checkOnlineDiamondUnlocks, 1200L, 1200L);
revivalManager.startActionBarTask();
}
@Override
public void onDisable() {
if (dataManager != null) dataManager.save();
}
public void reloadPluginConfig() {
reloadConfig();
for (Player player : Bukkit.getOnlinePlayers()) {
PlayerData data = dataManager.getOrCreate(player.getUniqueId());
data.setLives(Math.max(0, Math.min(data.getLives(), getConfig().getInt("life-system.max-lives", 10))));
if (data.getLives() == 0) data.setEliminated(true);
data.setSharpness(swordManager.clampSharpness(data.getSharpness()));
revivalManager.enforcePlayerState(player);
}
dataManager.save();
}
public PlayerDataManager getDataManager() { return dataManager; }
public SwordManager getSwordManager() { return swordManager; }
public FearManager getFearManager() { return fearManager; }
public RevivalManager getRevivalManager() { return revivalManager; }
}