L
📎 1 file 6,477 chars
📄
pasted-code-1785504623803.txt
txt 266 lines
▶
Plugin Name: Evolution Mace SMP
Platform Requirements
Paper 1.21.11
Java 21
Maven project
No Skript
No NMS
Use only the official Paper API
Plugin Overview

Create a Minecraft Paper 1.21.11 plugin that gives every player a permanent, evolving custom mace.

When a player joins the SMP for the first time, they automatically receive a Wooden Mace. As they earn player kills, the mace upgrades into stronger versions with unique abilities and enchantments.

If the player dies, their mace is downgraded by one tier, but their total kills are never reset.

The mace is permanent, cannot be lost, dropped, duplicated, or destroyed, and all progress must be saved permanently.

Mace Progression
Player Kills	Mace Tier
0	Wooden Mace
1	Iron Mace
2	Obsidian Mace
5	Emerald Mace
10	God Mace

Whenever a player reaches the required number of kills, their current mace should instantly transform into the next tier. The player should only ever have one Evolution Mace.

Death System

Whenever a player dies:

Downgrade the mace by exactly one tier.
Do not reset the player's kill count.

Example:

God Mace → Emerald Mace
Emerald Mace → Obsidian Mace
Obsidian Mace → Iron Mace
Iron Mace → Wooden Mace
Wooden Mace remains Wooden Mace
Mace Protection

The Evolution Mace must:

Never be dropped.
Never be thrown out of the inventory.
Never be placed in item frames.
Never be stored inside chests, barrels, shulker boxes, or other containers.
Never burn in lava or fire.
Never explode.
Never despawn.
Never be moved by hoppers.
Never be duplicated through any vanilla mechanic.
Automatically return to the owner's inventory after respawn if it somehow goes missing.
Only belong to its original owner.
Mace Tiers
Wooden Mace
Unlock Requirement

0 Kills

Display Name

Wooden Mace

Attack Damage

6

Enchantments
Density II
Curse of Vanishing
Passive Ability

None

Iron Mace
Unlock Requirement

1 Kill

Display Name

Iron Mace

Attack Damage

7

Enchantments
Density III
Wind Burst I
Curse of Vanishing
Passive Ability
Permanent +2 Hearts (Health Boost II)
Obsidian Mace
Unlock Requirement

2 Kills

Display Name

Obsidian Mace

Attack Damage

8

Enchantments
Density IV
Wind Burst II
Sharpness III
Looting II
Passive Ability
Permanent Fire Resistance
Emerald Mace
Unlock Requirement

5 Kills

Display Name

Emerald Mace

Attack Damage

9

Enchantments
Density V
Wind Burst II
Sharpness IV
Looting III
Passive Ability
Permanent Strength II
God Mace
Unlock Requirement

10 Kills

Display Name

God Mace

Attack Damage

10

Enchantments
Density VI
Wind Burst III
Sharpness VI
Looting III
Smite V
Passive Abilities
Permanent Strength II
Permanent Fire Resistance
Permanent Speed II
Passive Ability System

Passive abilities should always remain active while the player owns the corresponding Evolution Mace.

If the mace is upgraded, the player immediately gains the new abilities.

If the mace is downgraded, abilities from higher tiers must be removed instantly.

Potion effects should be refreshed automatically before they expire so there is no flickering.

First Join

When a player joins the server for the first time:

Automatically give them a Wooden Mace.
Save their player data permanently.

Returning players should have their mace and progress restored automatically.

Kill Tracking

Only player-versus-player (PvP) kills should count.

Do not count:

Mob kills
Suicide
Void deaths
Lava deaths
Fall damage
TNT or explosion kills without a direct player attacker
Environmental deaths
Fake kills

Only direct player kills should increase the kill count.

Commands
/mykill

Permission:

evolutionmace.mykill

Displays only to the player who executed the command.

Chat Message:

§a§lYour Kills: §2§l

The message should be bold, green, and visible only to the command sender.

Permissions
evolutionmace.mykill

Default: true

Data Storage

Store the following permanently using a YAML file or SQLite database:

Player UUID
Total Kills
Current Mace Tier
First Join Status

All progress must persist after server restarts.

Configuration

The plugin should include a configurable config.yml where server owners can edit:

Attack damage for each mace
Required kills for each tier
Messages
Ability settings
Upgrade and downgrade behavior
Technical Requirements
Fully compatible with Paper 1.21.11.
Use the official Minecraft Mace item.
Identify every custom mace using PersistentDataContainer (PDC) instead of display names.
Prevent renaming, duplication, crafting, or exploit-based bypasses.
Ensure players can never own more than one Evolution Mace.
Efficiently support 300+ concurrent players.
Use clean, optimized, object-oriented code.
Compile successfully with Java 21 and Maven without warnings or errors.
Include a complete project with plugin.yml, pom.xml, organized package structure, source code, and appropriate comments.

Passive Ability Rules

All passive abilities must only remain active while the player is carrying or possessing the corresponding Evolution Mace.

If the player upgrades to a higher-tier mace, the old abilities must be removed immediately and replaced with the new tier's abilities.
If the player dies and their mace is downgraded, all higher-tier abilities must be removed instantly, and only the abilities of the downgraded mace should remain.
If the player somehow loses access to the Evolution Mace (for example, due to an admin action or plugin), all passive abilities must be removed immediately.
Potion effects should refresh seamlessly without flickering, but they must only be active while the player owns the appropriate Evolution Mace.
Players must never keep any passive abilities after they no longer have the required mace tier.

Example:

Wooden Mace: No abilities.
Iron Mace: +2 Hearts only while the player has the Iron Mace.
Obsidian Mace: Infinite Fire Resistance only while the player has the Obsidian Mace.
Emerald Mace: Infinite Strength II only while the player has the Emerald Mace.
God Mace: Infinite Strength II, Fire Resistance, and Speed II only while the player has the God Mace.

This ensures that passive abilities are always tied to the player's current Evolution Mace tier and are removed immediately when the player no longer qualifies for them.
Kodari AI
KodariJul 31 at 1:36 pm 3
EvolutionMaceSMP
A Paper 1.21.11 SMP plugin that gives every player a permanent, owner-bound Evolution Mace. The mace progresses from Wooden to God tier as players earn direct PvP kills, gaining configurable damage, enchantments, and passive abilities. Death downgrades the mace without resetting kills. YAML persistence, PDC identification, anti-duplication protection, container and item-frame restrictions, automatic restoration, configurable messages, progression thresholds, and the /mykill command are included.
  1. Create the Maven Paper 1.21.11 project and plugin metadata.

  2. Implement persistent player progression, configurable mace tiers, item generation, and passive abilities.

  3. Add PvP kill tracking, death downgrades, restoration, commands, and exploit protection.

L

wooden mace name should be bold brown, iron mace name should be is bold silver, obsidian mace name should be in bold black, emerald mace name should be in bold green and god mace name should me in bold dark rainbow colour

Kodari AI
KodariJul 31 at 2:32 pm 1

Updated the mace names:

  • Wooden Mace: bold brown

  • Iron Mace: bold silver

  • Obsidian Mace: bold black

  • Emerald Mace: bold green

  • God Mace: bold dark-rainbow gradient

Changes were applied to both the default tier values and config.yml.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
14 1,070
src/main/java/com/kodari/evolutionmace/EvolutionMacePlugin.java
package com.kodari.evolutionmace;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Objects;

public class EvolutionMacePlugin extends JavaPlugin {
    private PlayerDataStore dataStore;
    private ConfigManager config;
    private MaceService maceService;
    private PassiveAbilityManager passiveAbilityManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        config = new ConfigManager(getConfig());
        dataStore = new PlayerDataStore(this);
        dataStore.load();

        EvolutionMaceFactory factory = new EvolutionMaceFactory(this, config);
        maceService = new MaceService(factory);
        passiveAbilityManager = new PassiveAbilityManager(config);

        getServer().getPluginManager().registerEvents(
                new PlayerListener(
                        this,
                        dataStore,
                        maceService,
                        passiveAbilityManager,
                        config
                ),
                this
        );
        getServer().getPluginManager().registerEvents(
                new ProtectionListener(maceService),
                this
        );

        Objects.requireNonNull(getCommand("mykill"))
                .setExecutor(new MyKillCommand(dataStore, config));

        Bukkit.getScheduler().runTaskTimer(
                this,
                () -> {
                    for (Player player : Bukkit.getOnlinePlayers()) {
                        refreshPlayer(player);
                    }
                },
                20L,
                20L
        );
    }

    @Override
    public void onDisable() {
        if (passiveAbilityManager != null) {
            passiveAbilityManager.clearAll(Bukkit.getOnlinePlayers());
        }
        if (dataStore != null) {
            dataStore.saveAll();
        }
        Bukkit.getScheduler().cancelTasks(this);
    }

    public void refreshPlayer(Player player) {
        PlayerProgress progress = dataStore.getOrCreate(player.getUniqueId());
        boolean hasMace = maceService.synchronize(player, progress);
        passiveAbilityManager.refresh(player, progress.getTier(), hasMace);
    }

    public void recordKill(Player killer) {
        PlayerProgress progress = dataStore.getOrCreate(killer.getUniqueId());
        progress.setKills(progress.getKills() + 1);

        if (config.isUpgradeEnabled()) {
            while (progress.getTier() != MaceTier.GOD) {
                MaceTier nextTier = progress.getTier().next();
                if (progress.getKills() < config.getRequiredKills(nextTier)) {
                    break;
                }
                progress.setTier(nextTier);
            }
        }

        dataStore.savePlayer(progress);
        refreshPlayer(killer);
    }
}