nullscapesbutworse

plugin where you can craft maces with different abilits like dash, etc.

Kodari AI
KodariJul 3 at 7:26 pm 15

I’ll build a plugin that lets players craft maces with special abilities like Dash, Slam, and Grapple.

CustomMaces
Craft special maces with unique abilities using custom recipes. Each mace has its own ability — Dash for a burst of speed, Slam for a ground-pound area attack, or Grapple to hook and pull yourself toward a target. Abilities trigger via swap-hands key with configurable cooldowns. Fully configurable via config.yml: names, lore, custom model data, cooldowns, and crafting recipes. Includes /mace command to give, list, and reload maces, plus permission-based admin controls.
nullscapesbutworse

make it like charmsmp in a way

Kodari AI
KodariJul 3 at 7:29 pm 37

Now implementing the CharmSMP-style server-wide craft limits per mace:

Now the CraftLimitManager and listener:

Just do a single patch properly:

Good, looks correct. Now add reload() call for craftLimitManager (not necessary since it loads from file independently) and now create the CraftLimitManager and CraftLimitListener classes, plus update MaceCommand for list display.

Now update MaceCommand’s list output to show crafted/max counts:

Now write the actual CraftLimitManager and CraftLimitListener content:

Now let’s verify the final CustomMaces.java compiles with correct references — already confirmed. Done.

CharmSMP-style addition: server-wide craft limits

  • Each mace now has a max-crafts config value (default 10) — once that many exist across the server, no one can craft more (checked in CraftLimitListener via PrepareItemCraftEvent/CraftItemEvent).

  • Crafted counts persist in mace_data.yml, tracked by CraftLimitManager.

  • /mace list now shows crafted/max per mace, and players get a mace-limit-reached message if they try to craft a maxed-out mace.

Kodari can make mistakes. Review important code before using.
Files
src
Code
16 914
src/main/java/com/kodari/custommaces/CustomMaces.java
package com.kodari.custommaces;

import com.kodari.custommaces.abilities.DashAbility;
import com.kodari.custommaces.abilities.GrappleAbility;
import com.kodari.custommaces.abilities.SlamAbility;
import com.kodari.custommaces.commands.MaceCommand;
import com.kodari.custommaces.listeners.AbilityListener;
import com.kodari.custommaces.listeners.CraftLimitListener;
import com.kodari.custommaces.managers.AbilityManager;
import com.kodari.custommaces.managers.ConfigManager;
import com.kodari.custommaces.managers.CraftLimitManager;
import com.kodari.custommaces.managers.MaceManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class CustomMaces extends JavaPlugin {

    private ConfigManager configManager;
    private MaceManager maceManager;
    private AbilityManager abilityManager;
    private CraftLimitManager craftLimitManager;

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

        this.configManager = new ConfigManager(this);
        this.maceManager = new MaceManager(this);
        this.abilityManager = new AbilityManager();

        abilityManager.registerAbility("DASH", new DashAbility());
        abilityManager.registerAbility("SLAM", new SlamAbility(this));
        abilityManager.registerAbility("GRAPPLE", new GrappleAbility());

        this.craftLimitManager = new CraftLimitManager(this);

        maceManager.loadMaces();
        maceManager.registerRecipes();

        getServer().getPluginManager().registerEvents(new AbilityListener(this), this);
        getServer().getPluginManager().registerEvents(new CraftLimitListener(this), this);

        MaceCommand maceCommand = new MaceCommand(this);
        getCommand("mace").setExecutor(maceCommand);
        getCommand("mace").setTabCompleter(maceCommand);
    }

    public void reload() {
        reloadConfig();
        configManager.reload();
        maceManager.loadMaces();
        maceManager.registerRecipes();
        craftLimitManager.load();
    }
}