harryyy_321

Make item upgrader plugin like there images and make sure idk that much ideas so make like profectionally It should provide a INVENTORY GUI-based upgrade system where:

Player puts an item (like pickaxe) in slot INVENTORY GUI shows current item (left) and upgraded result (right) Middle shows upgrade currency (emerald / money / items) Bottom shows requirements (red if missing, green if met) Clicking upgrade applies enchantments / stats 🧠 INVENTORY GUI LAYOUT (exact like image) [ ][ ][ ✨ ][ ][ ] [Pickaxe][ ][Emerald][ ][Upgraded Pickaxe] [ ][ ][ ][ ][ ] [Cost Item][❌][❌][❌][❌] Logic:

Left = input item Right = preview upgraded item Middle = cost type (emerald OR vault money OR custom item) Bottom = requirement slots (red glass if missing) ⚙️ FEATURES REQUIRED Custom upgrade paths (config based) Support:

Enchantments (Efficiency, Fortune etc) Custom lore Custom name NBT tags Upgrade types:

Money (Vault) Items (like cobblestone x12) Success:

Always success OR configurable chance Show messages: "No material required" "No enchantments" "Upgrade successful" "Not enough items"

4 images attached
Kodari AI
KodariJun 10 at 3:05 pm 41
ItemUpgrader
A professional GUI-based item upgrade plugin with a visual upgrade menu. Players place items in a dedicated slot and see a live preview of the upgraded result. Supports configurable upgrade paths with enchantments, custom name/lore, NBT-like overrides, Vault money costs or item costs, and success-chance mechanics. Features dynamic slot indicators (red/green) showing if requirements are met, sound effects, and a full reload command.

Planning all classes before writing:

  • ItemUp graderPlugin — main, initialises all managers, hooks Vault

  • ConfigManager — loads config.yml, builds UpgradePath list, exposes messages

  • UpgradeManager — findUpgradePath, canAfford, takeCost, buildUpgradedItem

  • model/ — CostType enum, UpgradeCost @Data, UpgradePath @Getter

  • inventory/ — InventoryHandler interface, InventoryButton, InventoryGUI (abstract)

  • inventory/gui/ — GUIManager, GUIListener

  • gui/UpgradeGUI — 4-row Upgrade Menu, full slot layout, live preview, click handling

  • commands/UpgradeCommand — /upgrade [reload]

  • utils/ItemBuilder — fluent item construction

GUI slot layout (36-slot, 4 rows):

Plain Text
[F][F][F][F][★][F][F][F][F]   row0 – star at 4
[F][IN][F][F][💰][F][F][OUT][F] row1 – input 10, cost-icon 13, preview 16
[F][F][F][F][F][F][F][F][F]   row2 – filler
[CM][R][R][R][R][F][F][F][F]  row3 – cost-mat 27, req-indicators 28-31

Here’s a summary of what was built:


🔨 ItemUpgrader — Feature Overview

GUI Layout (/upgrade)

Row
Slots
Content
0
4
✨
Nether Star
— click to upgrade
1
10 / 13 / 16
Item input
/ cost icon /
upgraded preview
3
27 / 28–31
Cost material with amount & 4 requirement indicators

Upgrade flow

  1. Player opens /upgrade → 4-row Upgrade Menu appears

  2. Player drags or shift-clicks an item into the left slot (10)

  3. Preview instantly refreshes — output item shown right, cost icon in the middle

  4. Bottom row: cost material (e.g. Cobblestone ×12) + 🟥 red panes if can’t afford → 🟩 green when ready

  5. Click the ✨ star to upgrade — takes cost, rolls success chance, replaces item

Config features

  • Per-upgrade: input.material, output.material + name + lore + enchantments

  • cost.type: ITEM or MONEY, with material + amount or money

  • success-chance: 0–100 (80% = 20% failure chance)

  • All messages customisable under messages:

Commands

  • /upgrade — opens the upgrade menu

  • /upgrade reload — reloads config without restart (permission: itemupgrader.reload)

harryyy_321

not add success and failure change just add drope rate set even if keep inventory is on and give as a jar file

Kodari AI
KodariJun 10 at 3:10 pm 24

Now I have everything. Here’s the plan:

  1. Replace successChance → dropChance in UpgradePath

  2. ConfigManager: read drop-chance not success-chance

  3. UpgradeGUI: remove fail roll, after upgrade roll drop chance — drop item at player’s feet (bypasses keepInventory)

  4. config.yml: update keys & default values

  5. Build and deliver the JAR

Now update UpgradeGUI — remove success-roll logic, add drop-chance logic, and update the cost icon lore:

Now update config.yml:The em-dash is causing a mismatch — doing a full rewrite instead:

Now build the JAR:

No Java or Gradle runtime is available in this environment — the JAR can’t be compiled server-side. Let me make sure all files are correct and give you a one-command build:

Config is correct. Now add the Gradle wrapper so you can build with a single command:

Also update build.gradle to add XSeries (JitPack) and a proper shadow jar since the system can’t auto-inject it here:


✅ All changes applied. Here’s how to build the JAR:

Requirements: Java 11+ and internet access

Shell
# Windows
gradlew.bat shadowJar

# Linux / Mac
chmod +x gradlew && ./gradlew shadowJar

or if you have Gradle installed globally:

Shell
gradle shadowJar

The compiled JAR will appear at:

Plain Text
build/libs/ItemUpgrader-1.0.jar

Drop it in your server’s plugins/ folder and restart.


🎲 Drop Rate — How it works

Config key
Behaviour
drop-chance: 0.0
Upgraded item always stays in the GUI slot (player picks it up normally)
drop-chance: 5.0
5% chance the upgraded item is spawned as a dropped entity at the player’s feet
drop-chance: 100.0
Item always drops on the ground after upgrading

The drop uses world.dropItemNaturally() which ignores the keepInventory gamerule entirely — the item is a physical dropped entity, not an inventory operation. Players will see the upgrade-dropped message (&eUpgrade successful — but your item dropped!) when it triggers.

Kodari can make mistakes. Review important code before using.
Files
gradle
src
build.gradle
gradlew
Code
19 1,159
src/main/java/com/kodari/itemupgrader/ItemUpgraderPlugin.java
package com.kodari.itemupgrader;

import com.kodari.itemupgrader.commands.UpgradeCommand;
import com.kodari.itemupgrader.inventory.gui.GUIListener;
import com.kodari.itemupgrader.inventory.gui.GUIManager;
import lombok.Getter;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public class ItemUpgraderPlugin extends JavaPlugin {

    @Getter private static ItemUpgraderPlugin instance;
    @Getter private ConfigManager configManager;
    @Getter private UpgradeManager upgradeManager;
    @Getter private GUIManager guiManager;
    @Getter private Economy economy;

    @Override
    public void onEnable() {
        instance = this;
        saveDefaultConfig();

        configManager = new ConfigManager(this);
        configManager.load();

        setupEconomy();

        upgradeManager = new UpgradeManager(this);
        guiManager = new GUIManager();

        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);

        UpgradeCommand upgradeCommand = new UpgradeCommand(this);
        getCommand("upgrade").setExecutor(upgradeCommand);
        getCommand("upgrade").setTabCompleter(upgradeCommand);

        getLogger().info("ItemUpgrader enabled — " + configManager.getAllPaths().size() + " upgrade(s) loaded.");
    }

    @Override
    public void onDisable() {
        getLogger().info("ItemUpgrader disabled.");
    }

    private void setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            getLogger().warning("Vault not found. Money upgrades will be disabled.");
            return;
        }
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager()
            .getRegistration(Economy.class);
        if (rsp == null) {
            getLogger().warning("No economy provider found. Money upgrades will be disabled.");
            return;
        }
        economy = rsp.getProvider();
        getLogger().info("Vault economy hooked: " + economy.getName());
    }
}