olarrrrr_09

Make a plugin where everyone spawns in with a unenchanted mace and every time you kill someone you get a density level upgrades going all the way up to 5 every time u die u lose one and u cant enchant a mace unless u get a kill

Kodari AI
KodariMar 3 at 7:55 pm 14,056 (v2)

I’ll create a Mace combat plugin where kills upgrade your weapon with Density enchantment.

MaceKills
A competitive Mace combat system where players spawn with unenchanted maces and earn Density enchantment levels through kills. Each kill grants one Density level (maximum 5), while each death removes one level. Players cannot manually enchant maces through enchanting tables or anvils - the only way to upgrade is through PvP combat. Features automatic mace distribution on spawn and real-time enchantment updates.

Plugin created! Here’s what it does:

Core Features:

  • Players spawn with an unenchanted mace on join/respawn

  • Each kill adds +1 Density level (max 5) to your mace

  • Each death removes -1 Density level (min 0)

  • Enchanting tables are blocked for maces - kills are the only upgrade path

  • Real-time mace updates when you get a kill

How it works: Your density level persists across deaths. If you have 3 kills and die once, you respawn with a Density II mace. The system tracks your kill/death ratio and automatically manages your mace enchantment level.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
4 186
src/main/java/com/macestrikes/MaceKillsPlugin.java
package com.macestrikes;

import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.HashMap;
import java.util.UUID;

@Getter
public class MaceKillsPlugin extends JavaPlugin {
    private HashMap<UUID, Integer> densityLevels;
    
    @Override
    public void onEnable() {
        densityLevels = new HashMap<>();
        getServer().getPluginManager().registerEvents(new MaceListener(this), this);
        getLogger().info("MaceKills has been enabled!");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("MaceKills has been disabled!");
    }
    
    public int getDensityLevel(UUID uuid) {
        return densityLevels.getOrDefault(uuid, 0);
    }
    
    public void setDensityLevel(UUID uuid, int level) {
        densityLevels.put(uuid, Math.max(0, Math.min(5, level)));
    }
    
    public void increaseDensity(UUID uuid) {
        int current = getDensityLevel(uuid);
        if (current < 5) {
            setDensityLevel(uuid, current + 1);
        }
    }
    
    public void decreaseDensity(UUID uuid) {
        int current = getDensityLevel(uuid);
        if (current > 0) {
            setDensityLevel(uuid, current - 1);
        }
    }
}