concacute

Develop a robust blacksmith plugin for Minecraft that integrates with MMOItems, allowing players to forge weapons with both beneficial (Hen) and detrimental (Xui) upgrades based on configurable stats. Include a INVENTORY GUI for the forging process, requiring items and currency, with different costs depending on the item tier, and enable NPCs to handle enchanting and clearing of existing enchantments for experience points. Ensure compatibility with Citizens for NPC interactions and provide configuration options to prevent INVENTORY GUI conflicts with PE Geyser Floodgate.

Kodari AI
KodariAug 7 at 7:03 pm 3
BlacksmithForge
BlacksmithForge is a MMOItems-integrated blacksmithing plugin with GUI-based forging. Players forge weapons applying random Hen (beneficial) or Xui (detrimental) upgrades from configurable stat pools. Forging requires items and currency, with costs scaling by item tier. Citizens NPCs handle enchanting and enchantment clearing for experience points. Includes configurable inventory GUI settings to prevent conflicts with PE Geyser Floodgate clients, ensuring compatibility across platforms.
  1. Create a Maven-based Bukkit plugin with configurable Hen/Xui upgrades, tiered costs, catalysts, currency, and XP operations.

  2. Add a reusable inventory GUI framework plus the forging, enchanting, and enchantment-clearing menus.

  3. Integrate MMOItems through a safe runtime bridge, Citizens NPC routing, and Floodgate-aware GUI policy.

  4. Add plugin metadata and configuration with compatibility-focused defaults.

The initial implementation is in place. I’m applying one compatibility cleanup so item fallback and enchantment clearing avoid direct Bukkit enum usage where XSeries or API inference is sufficient.

  1. Created a Maven-based KodariBlacksmith plugin with MMOItems, Vault, Citizens, Floodgate, and Geyser soft dependencies.

  2. Added configurable Hen and Xui upgrades with stat ranges, success chances, tier-based costs, catalysts, currency, and experience requirements.

  3. Implemented inventory GUIs for:

    • Weapon forging

    • NPC enchanting

    • Clearing enchantments and blacksmith upgrades

  4. Added MMOItems runtime integration with persistent upgrade metadata.

  5. Added Vault currency handling and configurable tier pricing.

  6. Added Citizens NPC routing using configurable enchanting and clearing NPC IDs.

  7. Added Floodgate detection with a configurable gui.enabled-on-bedrock setting to avoid Bedrock GUI conflicts.

  8. Added /blacksmith, /blacksmith enchant, /blacksmith clear, and /blacksmith reload commands.

  9. Added reusable GUI manager, listener, button, and inventory handler classes.

  10. Added pom.xml, plugin.yml, and a complete configurable config.yml.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
18 1,259
src/main/java/com/kodari/blacksmith/BlacksmithPlugin.java
package com.kodari.blacksmith;

import com.kodari.blacksmith.command.BlacksmithCommand;
import com.kodari.blacksmith.config.BlacksmithConfig;
import com.kodari.blacksmith.economy.CurrencyService;
import com.kodari.blacksmith.gui.GUIListener;
import com.kodari.blacksmith.gui.GUIManager;
import com.kodari.blacksmith.integration.CitizensListener;
import com.kodari.blacksmith.integration.FloodgatePolicy;
import com.kodari.blacksmith.integration.MMOItemsBridge;
import com.kodari.blacksmith.service.ForgeService;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class BlacksmithPlugin extends JavaPlugin {
    private BlacksmithConfig blacksmithConfig;
    private GUIManager guiManager;
    private ForgeService forgeService;
    private MMOItemsBridge mmoItemsBridge;
    private FloodgatePolicy floodgatePolicy;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        blacksmithConfig = new BlacksmithConfig(this);
        mmoItemsBridge = new MMOItemsBridge(this, blacksmithConfig);
        CurrencyService currencyService = new CurrencyService(this, blacksmithConfig);
        forgeService = new ForgeService(this, blacksmithConfig, mmoItemsBridge, currencyService);
        floodgatePolicy = new FloodgatePolicy(this, blacksmithConfig);
        guiManager = new GUIManager();

        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        BlacksmithCommand command = new BlacksmithCommand(this);
        if (getCommand("blacksmith") != null) {
            getCommand("blacksmith").setExecutor(command);
            getCommand("blacksmith").setTabCompleter(command);
        }

        if (Bukkit.getPluginManager().getPlugin("Citizens") != null) {
            Bukkit.getPluginManager().registerEvents(new CitizensListener(this), this);
        }
    }

    public void reloadBlacksmith() {
        reloadConfig();
        blacksmithConfig = new BlacksmithConfig(this);
        mmoItemsBridge = new MMOItemsBridge(this, blacksmithConfig);
        forgeService = new ForgeService(this, blacksmithConfig, mmoItemsBridge,
                new CurrencyService(this, blacksmithConfig));
        floodgatePolicy = new FloodgatePolicy(this, blacksmithConfig);
    }

    public BlacksmithConfig getBlacksmithConfig() {
        return blacksmithConfig;
    }

    public GUIManager getGuiManager() {
        return guiManager;
    }

    public ForgeService getForgeService() {
        return forgeService;
    }

    public MMOItemsBridge getMmoItemsBridge() {
        return mmoItemsBridge;
    }

    public FloodgatePolicy getFloodgatePolicy() {
        return floodgatePolicy;
    }
}