Create a complete Minecraft Paper plugin named Sword_Smp.
Author: itz_miikey
Target: Latest stable Paper Minecraft version. The plugin must use the modern Paper API and Java version required by the target Minecraft version.
I need the plugin as a fully working, production-ready ".jar", not just example code. Also provide the complete source code/project so it can be compiled again.
CORE CONCEPT
This is a custom Sword SMP progression system.
Every player has a special SMP sword. Normal players must NOT be able to craft any swords themselves.
The special swords are:
- Wooden Sword — starting sword
- Diamond Sword — upgraded sword after a configurable number of days
The special sword must be identifiable using PersistentDataContainer/custom data, so normal vanilla swords cannot be treated as the SMP sword.
---
- FIRST JOIN — WOODEN SWORD
When a player joins the server for the first time:
- Give them exactly one special Wooden Sword.
- The sword must have Sharpness I.
- Its durability must NEVER decrease.
- It must always remain at full durability.
- The sword must NOT disappear when the player dies.
- The sword must remain with the player after death.
- The sword should have a custom name such as:
"§6SMP Sword"
- Sword type - Current Sharpness - Kill progress
The plugin must prevent players from obtaining duplicate special swords.
If the player already has their special sword, do not give another one.
---
- WOODEN SWORD → DIAMOND SWORD
Add a configurable setting in "config.yml":
diamond-sword-days: 7
This means that after the configured number of days from the player's first join, their Wooden SMP Sword should be replaced with the Diamond SMP Sword.
The number of days MUST be configurable without editing the Java source.
Example:
diamond-sword-days: 7
After 7 days:
- Remove the special Wooden Sword.
- Give the player the special Diamond Sword.
- Diamond Sword starts at Sharpness I.
- Preserve the player's SMP progression data appropriately.
- Do not give duplicate Diamond Swords.
The timer should be based on the player's first-join timestamp rather than server uptime.
---
- SWORD DURABILITY
The special SMP sword must NEVER lose durability.
Whenever the sword takes durability damage:
- Cancel/prevent the durability loss.
- Keep the sword at maximum durability.
This must work for both:
- Wooden Sword
- Diamond Sword
Also protect the sword from being destroyed by normal gameplay.
---
- DEATH SYSTEM
The special sword must remain with the player when they die.
Prevent the special SMP sword from being dropped on death.
The player should still have the same sword after respawning.
Do not create a duplicate sword during respawn.
---
- SHARPNESS PROGRESSION
Diamond SMP Sword starts at:
Sharpness I
Kills increase Sharpness.
Maximum Sharpness:
Sharpness X
The progression must work exactly like this:
Sharpness 1 → 2
Requires 1 kill
Sharpness 2 → 3
Requires 2 kills
Sharpness 3 → 4
Requires 2 kills
Sharpness 4 → 5
Requires 2 kills
Sharpness 5 → 6
Requires 3 kills
Sharpness 6 → 7
Requires 3 kills
Sharpness 7 → 8
Requires 3 kills
Sharpness 8 → 9
Requires 3 kills
Sharpness 9 → 10
Requires 3 kills
Sharpness must never exceed 10.
After reaching Sharpness 10, further kills must not increase it.
The kill progress must be stored persistently so it survives:
- Server restart
- Player logout/login
- Server crash
---
- IMPORTANT: SHARPNESS 5+ DEATH RESET
If a player dies while their SMP sword has:
- Sharpness 1 → keep Sharpness 1
- Sharpness 2 → keep Sharpness 2
- Sharpness 3 → keep Sharpness 3
- Sharpness 4 → keep Sharpness 4
BUT:
If a player dies with:
- Sharpness 5
- Sharpness 6
- Sharpness 7
- Sharpness 8
- Sharpness 9
- Sharpness 10
Then after they respawn:
Reset their SMP sword to Sharpness I.
Also reset their kill progression to zero.
The sword itself must remain with them.
---
- SHARPNESS 10 EVENT
When a player reaches Sharpness 10 for the first time:
Create a server-wide special event.
Effects:
- Start a thunderstorm.
- Make the weather dramatic.
- Send a server-wide chat message.
Example format:
[SERVER] L4zye has become THE STRONGEST ONE of the server!
Replace "L4zye" with the actual player's username.
Make the message dramatic and customizable.
Play suitable vanilla Minecraft sounds/effects if possible.
Do NOT repeatedly trigger the Sharpness 10 event every time the player reconnects.
It should trigger when the player actually reaches Sharpness 10.
---
- SHARPNESS 10 PLAYER DIES
If a player dies while they have Sharpness 10:
- Trigger another thunderstorm/event effect.
- Broadcast a dramatic message.
The message should sound like the Devil is disappointed in the player because they lost their power.
Example:
[DEVIL] I expected more from you... [DEVIL] You were supposed to be useful to me. [DEVIL] Now your power has returned to its beginning.
Then after respawn:
- Sword remains with player.
- Sharpness becomes I.
- Kill progress resets to zero.
Make the dialogue configurable in "config.yml".
---
- SWORD CRAFTING RESTRICTION
Players must NOT be able to craft normal swords.
Block crafting recipes for:
- Wooden Sword
- Stone Sword
- Iron Sword
- Golden Sword
- Diamond Sword
- Netherite Sword
Cancel the crafting event if a player attempts to craft any sword.
The only swords obtainable through this system are the special SMP swords given by the plugin.
IMPORTANT:
Do not simply block the entire crafting table.
Only block sword crafting recipes.
Also make sure players cannot bypass the restriction through shift-click crafting.
---
- SPECIAL SWORD IDENTIFICATION
Use "PersistentDataContainer" / NamespacedKey to mark the special SMP sword.
Do NOT identify the sword only by:
The plugin should be able to distinguish:
Normal Diamond Sword
from:
Sword_Smp Diamond Sword
This is important for preventing exploits.
---
- EXPLOIT PROTECTION
Prevent players from abusing the sword system.
Handle cases such as:
- Dropping the SMP sword
- Throwing it into lava
- Putting it into containers
- Putting it into a hopper
- Putting it into a chest
- Duplicating it
- Moving it using suspicious inventory interactions
- Getting multiple copies
- Crafting a replacement
- Losing it permanently
The goal is that every player has exactly one valid SMP sword.
If the sword somehow gets lost due to an unexpected situation, provide a safe way for the plugin to restore the player's sword without creating duplicates.
---
- CONFIG.YML
Create a clean and editable "config.yml".
At minimum include:
diamond-sword-days: 7
starting-sharpness: 1
maximum-sharpness: 10
announcements: true
thunderstorm-on-sharpness-10: true
thunderstorm-on-death: true
block-sword-crafting: true
strongest-player-message: "..."
devil-death-message: - "..." - "..." - "..."
Also make the kill requirements configurable if practical.
---
- ADMIN COMMANDS
Create an admin command:
/swordsmp
Permission:
swordsmp.admin
Useful subcommands:
/swordsmp reload /swordsmp give <player> /swordsmp reset <player> /swordsmp info <player> /swordsmp setdays <days>
"/swordsmp reload"
"/swordsmp give <player>"
- Give/restore the player's correct SMP sword.
"/swordsmp reset <player>"
- Reset their Sharpness and kill progress.
"/swordsmp info <player>"
- Show their current sword, Sharpness and kill progress.
"/swordsmp setdays <days>"
- Change the configured Diamond Sword upgrade period.
Only operators / players with "swordsmp.admin" can use these commands.
---
- PLAYER INFORMATION
Add useful information to the sword lore.
Example:
SMP Sword Sharpness: V Kills: 1/3 Next Sharpness: VI
Update the lore whenever:
- A kill happens
- Sharpness increases
- Sword upgrades
- Player dies and Sharpness resets
Use Roman numerals where appropriate:
I, II, III, IV, V, VI, VII, VIII, IX, X
---
- DATA STORAGE
Player data must survive server restarts.
Store at least:
- First join timestamp
- Whether Diamond Sword has been unlocked
- Current Sharpness
- Current kill progress
- Whether Sharpness 10 event has already occurred, if necessary
Use a reliable persistent storage method such as YAML/JSON or another lightweight method.
Do not rely only on memory.
---
- CODE QUALITY
The plugin should be:
- Cleanly organized
- Efficient
- Event-driven
- Safe against duplication exploits
- Compatible with modern Paper API
- Free from unnecessary dependencies
- Easy to configure
Avoid deprecated Bukkit/Paper APIs where modern alternatives exist.
Include:
plugin.yml config.yml Java source files pom.xml README.md
The final project should compile successfully with Maven.
---
- FINAL BUILD
I need:
- Complete source code
- Complete Maven project
- "plugin.yml"
- "config.yml"
- README with installation instructions
- A compiled:
Sword_Smp.jar
The final ".jar" must be ready to place inside:
plugins/
on a Paper server.
Before giving the final result, test the code for compilation errors and fix them.
Do not give me pseudocode or incomplete snippets. I want a complete working plugin.