MIKEY

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:

  1. Wooden Sword — starting sword
  2. 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.

---

  1. 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"

  • Add useful lore showing:

- 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.

---

  1. 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.

---

  1. 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.

---

  1. 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.

---

  1. 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

---

  1. 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.

---

  1. 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.

---

  1. 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".

---

  1. 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.

---

  1. SPECIAL SWORD IDENTIFICATION

Use "PersistentDataContainer" / NamespacedKey to mark the special SMP sword.

Do NOT identify the sword only by:

  • Material
  • Name
  • Lore

The plugin should be able to distinguish:

Normal Diamond Sword

from:

Sword_Smp Diamond Sword

This is important for preventing exploits.

---

  1. 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.

---

  1. 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.

---

  1. 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"

  • Reload config.

"/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.

---

  1. 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

---

  1. 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.

---

  1. 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.

---

  1. FINAL BUILD

I need:

  1. Complete source code
  2. Complete Maven project
  3. "plugin.yml"
  4. "config.yml"
  5. README with installation instructions
  6. 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.

Kodari AI
KodariSep 12 at 2:47 pm 16
SwordSmpProgression
A comprehensive Paper plugin implementing a custom SMP sword progression system. Players receive a special indestructible Wooden Sword on first join that upgrades to Diamond after configurable days. Sharpness increases through kills (I-X) with death penalties at Sharpness 5+. Features thunderstorm events at Sharpness 10, sword crafting restrictions, persistent player data storage, admin commands, and exploit protection. Uses PersistentDataContainer for sword identification and YAML for configuration.
  1. Create the Java 21 / Paper Maven project and plugin metadata.

  2. Implement persistent player progression and PDC-marked, indestructible swords.

  3. Add progression, death retention/reset, crafting restrictions, and inventory exploit protections.

  4. Add configurable announcements, admin commands, and installation documentation.

  1. Core Maven/Paper project and sources are created.

  2. Adding the final missing drop protection and continuous lost-sword recovery safeguard.Created the complete Maven/Paper source project for Sword_Smp:

  • PDC-marked, owner-bound Wooden/ Diamond SMP swords

  • Persistent players.yml progression data

  • Real-time first-join Diamond upgrade timer

  • Unbreakable durability protection, death retention, reset behavior at Sharpness V+

  • Configurable kill requirements, broadcasts, thunderstorms, and Devil dialogue

  • Sword crafting restrictions including shift crafting

  • Container/hopper/drop protections plus automatic recovery of the one valid sword

  • /swordsmp reload|give|reset|info|setdays admin command

  • plugin.yml, config.yml, pom.xml, and README.md

Build the deployable JAR with Java 21 and Maven:

Shell
mvn clean package

The ready-to-install file will be:

Plain Text
target/Sword_Smp.jar

This environment does not include Maven or a compiler, so I could not generate or compilation-test the binary here.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
Code
11 917
src/main/java/com/itzmiikey/swordsmp/SwordSmpPlugin.java
package com.itzmiikey.swordsmp;

import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public class SwordSmpPlugin extends JavaPlugin {
    private PlayerDataStore dataStore;
    private SwordService swordService;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        dataStore = new PlayerDataStore(this);
        dataStore.load();
        swordService = new SwordService(this);

        getServer().getPluginManager().registerEvents(new SwordListener(this), this);
        SwordSmpCommand command = new SwordSmpCommand(this);
        if (getCommand("swordsmp") != null) {
            getCommand("swordsmp").setExecutor(command);
            getCommand("swordsmp").setTabCompleter(command);
        }

        getServer().getScheduler().runTaskTimer(this, () -> {
            for (Player player : getServer().getOnlinePlayers()) {
                PlayerData data = dataStore.getOrCreate(player.getUniqueId());
                if (swordService.updateUpgradeState(data)) {
                    swordService.ensureCorrectSword(player);
                    player.sendMessage("§bYour SMP Sword has been upgraded to Diamond!");
                } else {
                    swordService.ensureCorrectSword(player);
                }
            }
        }, 1200L, 1200L);
    }

    @Override
    public void onDisable() {
        if (dataStore != null) {
            dataStore.save();
        }
    }

    public PlayerDataStore getDataStore() {
        return dataStore;
    }

    public SwordService getSwordService() {
        return swordService;
    }

    public int getStartingSharpness() {
        return Math.max(1, Math.min(10, getConfig().getInt("starting-sharpness", 1)));
    }

    public int getMaximumSharpness() {
        return Math.max(getStartingSharpness(), Math.min(10, getConfig().getInt("maximum-sharpness", 10)));
    }

    public long getDiamondSwordDays() {
        return Math.max(0L, getConfig().getLong("diamond-sword-days", 7L));
    }

    public void startThunderstorm(Player player) {
        for (World world : getServer().getWorlds()) {
            world.setStorm(true);
            world.setThundering(true);
            world.setWeatherDuration(1200);
            world.setThunderDuration(1200);
        }
        player.getWorld().strikeLightningEffect(player.getLocation());
        player.playSound(player.getLocation(), "entity.lightning_bolt.thunder", 1.0f, 0.7f);
    }

    public String message(String path) {
        return color(getConfig().getString(path, ""));
    }

    public String color(String message) {
        return ChatColor.translateAlternateColorCodes('&', message);
    }
}