Raj Chakraborty

ReCoinShop – Complete Minecraft Plugin Development Prompt

Develop a professional, fully functional Minecraft Java plugin named ReCoinShop for Minecraft 1.21.11.

The plugin must provide its own built-in currency system and customizable shop GUI. It must work independently without requiring any external dependencies.

  1. Plugin Information
  • Plugin Name: ReCoinShop
  • Minecraft Version: 1.21.11
  • Supported Platforms: Paper, Spigot and Bukkit
  • Main Management Command: "/rcshop"
  • Balance Command: "/coin"
  • Shop GUI Command: "/coins"
  • Reload Command: "/rcreload"
  • Language: Java
  • External Dependencies: None

Do not require DeluxeMenus, ExcellentCurrency, Vault, PlaceholderAPI, PlayerPoints or any other external plugin.

  1. Menu Creation System

The menu creation command must use this exact syntax:

"/rcshop menu create <rows><menu_name> slot <slot>"

Example:

"/rcshop menu create 6exampleshop slot 1"

Requirements:

  • "6" represents the number of inventory rows.
  • "exampleshop" represents the menu ID.
  • "slot 1" represents the menu's opening position in the main shop GUI.
  • Support 1 to 6 rows (9, 18, 27, 36, 45 and 54 inventory slots).
  • Automatically create and save the menu.
  • Allow custom menu titles and colors.
  • Allow unlimited menus.
  • Prevent duplicate menu IDs.

Menu management commands:

  • "/rcshop menu create"
  • "/rcshop menu edit <menu_name>"
  • "/rcshop menu delete <menu_name>"
  • "/rcshop menu list"
  • "/rcshop menu open <menu_name>"
  1. Item Creation System

The item creation command must use this exact syntax:

"/rcshop item add menu <menu_name> item <material> price <amount> slot <slot> lore <lore>"

Example:

"/rcshop item add menu example item diamond_sword price 100 slot 1 lore &aFOR UR ADVENTURES"

The command must automatically:

  • Find the selected menu.
  • Create the specified Minecraft item.
  • Set its price.
  • Set its inventory slot.
  • Apply the specified lore.
  • Support spaces in lore.
  • Support Minecraft color codes using "&".
  • Save the item automatically.

Allow any valid Minecraft material.

Additional item properties:

  • Custom display name.
  • Multiple lore lines.
  • Amount.
  • Price.
  • Currency.
  • Slot.
  • Enchantments.
  • Item flags.
  • Custom model data where supported.

Item management commands:

  • "/rcshop item add"
  • "/rcshop item edit"
  • "/rcshop item remove"
  • "/rcshop item list"

Examples:

"/rcshop item edit menu example item diamond_sword price 200"

"/rcshop item remove menu example item diamond_sword"

Administrators must be able to add, edit and remove items directly through commands without manually editing YAML files.

  1. GUI System

The main shop GUI must open using:

"/coins"

Requirements:

  • Default GUI size: 36 slots.
  • Display all available shop menus.
  • Allow players to click a menu to open it.
  • Support unlimited shop menus.
  • Support unlimited shop items.
  • Allow custom menu icons.
  • Allow configurable menu positions.
  • Prevent players from taking, moving or modifying GUI items.
  • Support custom GUI titles and colors.

When a player clicks a shop item:

  1. Check the player's currency balance.
  2. Check whether they have enough currency.
  3. Remove the required amount.
  4. Give the purchased item.
  5. Send a purchase confirmation message.

If the player does not have enough currency, display an appropriate error message.

  1. Built-in Currency System

Create a complete currency system inside ReCoinShop.

No external economy plugin should be required.

Requirements:

  • Unlimited currency types.
  • Unlimited player balances.
  • Separate balance for every currency.
  • Custom currency names and symbols.
  • Permanent data storage.
  • Automatic saving.
  • Support different currencies for different shop items.
  • Configurable default currency.

Commands:

  • "/coin" - Show default currency balance.
  • "/coin balance" - Check balance.
  • "/coin balance <player>" - Check another player's balance.
  • "/coin give <player> <amount>"
  • "/coin take <player> <amount>"
  • "/coin set <player> <amount>"
  • "/coin pay <player> <amount>"

Also provide currency management commands:

  • "/rcshop currency create <currency>"
  • "/rcshop currency edit <currency>"
  • "/rcshop currency delete <currency>"
  • "/rcshop currency list"
  1. Tab Completion

This is a very important requirement.

Implement complete dynamic tab completion for all commands.

When typing "/rcshop", show:

  • menu
  • item
  • currency

When typing "/rcshop menu", show:

  • create
  • edit
  • delete
  • list
  • open

When typing "/rcshop item", show:

  • add
  • edit
  • remove
  • list

When typing "/rcshop currency", show:

  • create
  • edit
  • delete
  • list

Tab completion must also suggest:

  • Existing menu names.
  • Existing item IDs.
  • Available Minecraft materials.
  • Existing currency names.
  • Valid inventory slots.
  • Online player names.

Suggestions must depend on the current argument position.

  1. Reload Command

Command:

"/rcreload"

It must reload:

  • Main configuration.
  • Currency configuration.
  • Menu configurations.
  • Shop item configurations.
  • Messages.
  • All saved settings.

Changes should apply without restarting the server.

  1. Configuration and Data Storage

Automatically generate:

  • "config.yml"
  • "messages.yml"
  • "currencies.yml"
  • "menus/"
  • "data/"

All menus, items and currencies created through commands must automatically save to their respective files.

Player balances must be stored using UUIDs.

Prevent data loss during reloads and server restarts.

  1. Permissions

Create permissions for:

  • "recoinshop.admin"
  • "recoinshop.menu.create"
  • "recoinshop.menu.edit"
  • "recoinshop.menu.delete"
  • "recoinshop.item.add"
  • "recoinshop.item.edit"
  • "recoinshop.item.remove"
  • "recoinshop.currency.create"
  • "recoinshop.currency.edit"
  • "recoinshop.currency.delete"
  • "recoinshop.reload"
  • "recoinshop.balance"
  • "recoinshop.pay"
  1. Important Technical Requirements
  • No external dependencies.
  • Fully standalone currency and shop system.
  • Support unlimited menus, items and currencies.
  • Default main shop GUI size must be 36 slots.
  • Menu sizes must support 1–6 rows.
  • Menu opening slots must be configurable.
  • Item slots must be configurable.
  • Use user-friendly 1-based slot numbering in commands.
  • Validate all commands and arguments.
  • Prevent invalid materials, negative prices and invalid slots.
  • Prevent duplicate item IDs.
  • Use optimized Java code.
  • Ensure compatibility with Paper, Spigot and Bukkit.
  • Use proper event handling and inventory protection.
  • Provide clear success and error messages.
  1. Final Deliverables

Provide:

  1. Complete Java source code.
  2. Compiled "ReCoinShop.jar".
  3. All configuration files.
  4. Proper "plugin.yml".
  5. Installation instructions.
  6. Complete command and permission documentation.

FINAL INSTRUCTION:

Build a complete and working ReCoinShop plugin, not just a basic example.

Every command must work exactly as documented. Creating menus, adding items, editing items, removing items, managing currencies and opening shop GUIs must all function correctly.

The plugin must automatically create and save everything when administrators execute commands. Manual YAML editing must not be required for normal shop management.

The final plugin must be lightweight, optimized and completely independent of other plugins.

Kodari AI
KodariNov 10 at 3:49 am 4
ReCoinShop
A standalone Minecraft shop plugin with built-in multi-currency economy system. Features dynamic menu creation via commands, unlimited customizable shop menus with configurable sizes and slots, item management with prices, lore, enchantments and custom model data. Includes complete currency system with player balances stored by UUID, balance management commands, and pay functionality. Provides full tab completion for all commands, reload support, automatic configuration generation, and comprehensive permission system. No external dependencies required, works on Paper, Spigot and Bukkit servers.
  • Build persistent, UUID-based currencies and paginated shop menus.

  • Add command-based management, permissions, tab completion, and protected purchase GUIs.

  • Include default configuration and command documentation.

ReCoinShop’s source, configurations, permissions, and command documentation are in place. See COMMANDS.md for installation and usage.

The jar has not been compiled in this session. To get it, click Compile in Kodari, then download the successful build.

Kodari can make mistakes. Review important code before using.
Files
src
COMMANDS.md
Code
6 530
src/main/java/com/kodari/recoinshop/ReCoinShop.java
package com.kodari.recoinshop;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XEnchantment;
import com.cryptomorin.xseries.XItemFlag;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;

public final class ReCoinShop extends JavaPlugin implements Listener, CommandExecutor, TabCompleter {
    private YamlConfiguration messages, currencies, balances;
    private final Map<String, YamlConfiguration> menus = new TreeMap<>();
    private File menuDir, dataFile;

    @Override public void onEnable() {
        saveDefaultConfig();
        if (!new File(getDataFolder(), "messages.yml").exists()) saveResource("messages.yml", false);
        if (!new File(getDataFolder(), "currencies.yml").exists()) saveResource("currencies.yml", false);
        menuDir = new File(getDataFolder(), "menus");
        menuDir.mkdirs();
        File dataDir = new File(getDataFolder(), "data");
        dataDir.mkdirs();
        dataFile = new File(dataDir, "balances.yml");
        loadFiles();
        Bukkit.getPluginManager().registerEvents(this, this);
        for (String name : Arrays.asList("rcshop", "coin", "coins", "rcreload")) {
            Objects.requireNonNull(getCommand(name)).setExecutor(this);
            Objects.requireNonNull(getCommand(name)).setTabCompleter(this);
        }
    }

    private void loadFiles() {
        reloadConfig();
        messages = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "messages.yml"));
        currencies = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "currencies.yml"));
        balances = YamlConfiguration.loadConfiguration(dataFile);
        menus.clear();
        File[] files = menuDir.listFiles((dir, name) -> name.endsWith(".yml"));
        if (files != null) for (File file : files) menus.put(file.getName().substring(0, file.getName().length() - 4), YamlConfiguration.loadConfiguration(file));
    }

    private void save(YamlConfiguration yaml, File file) {
        try { yaml.save(file); } catch (IOException ex) { throw new IllegalStateException("Could not save " + file, ex); }
    }
    private void saveMenu(String id) { save(menus.get(id), new File(menuDir, id + ".yml")); }
    private void saveCurrencies() { save(currencies, new File(getDataFolder(), "currencies.yml")); }
    private void saveBalances() { save(balances, dataFile); }
    private String color(String s) { return ChatColor.translateAlternateColorCodes('&', s == null ? "" : s); }
    private void msg(CommandSender sender, String text) { sender.sendMessage(color(messages.getString("prefix", "&6[ReCoinShop] &r") + text)); }
    private boolean allowed(CommandSender s, String permission) {
        if (s.hasPermission(permission) || s.hasPermission("recoinshop.admin")) return true;
        msg(s, messages.getString("no-permission", "&cNo permission.")); return false;
    }
    private boolean idValid(String id) { return id.matches("[a-z0-9_-]{1,64}"); }
    private String normalize(String s) { return s.toLowerCase(Locale.ROOT); }
    private Set<String> keys(ConfigurationSection section) { return section == null ? Collections.emptySet() : section.getKeys(false); }
    private Set<String> currencyIds() { return keys(currencies.getConfigurationSection("currencies")); }
    private String defaultCurrency() { return normalize(getConfig().getString("default-currency", "coins")); }
    private String currencyName(String id) { return currencies.getString("currencies." + id + ".name", id); }
    private long balance(UUID uuid, String id) { return balances.getLong(uuid + "." + id, 0); }
    private void balance(UUID uuid, String id, long value) { balances.set(uuid + "." + id, value); }
    private long number(String s, boolean zero) {
        long n = Long.parseLong(s);
        if (n < 0 || (!zero && n == 0)) throw new IllegalArgumentException("Amount must be " + (zero ? "non-negative" : "positive") + ".");
        return n;
    }
    private int slot(String s) {
        int n = Integer.parseInt(s);
        if (n < 1 || n > 1000000) throw new IllegalArgumentException("Slot must be between 1 and 1000000.");
        return n;
    }
    private ItemStack material(String name) {
        ItemStack item = XMaterial.matchXMaterial(name.toUpperCase(Locale.ROOT)).map(XMaterial::parseItem).orElse(null);
        if (item == null || item.getType().isAir()) throw new IllegalArgumentException("Invalid item material: " + name);
        return item;
    }
    private OfflinePlayer player(String name) {
        Player online = Bukkit.getPlayerExact(name);
        if (online != null) return online;
        OfflinePlayer offline = Bukkit.getOfflinePlayer(name);
        if (!offline.hasPlayedBefore()) throw new IllegalArgumentException("Player has never joined: " + name);
        return offline;
    }

    @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        try {
            switch (command.getName().toLowerCase(Locale.ROOT)) {
                case "rcreload":
                    if (allowed(sender, "recoinshop.reload")) { saveBalances(); loadFiles(); msg(sender, "&aConfiguration and data reloaded."); }
                    break;
                case "coins":
                    if (!(sender instanceof Player)) throw new IllegalArgumentException("Only players can open the shop.");
                    openMain((Player) sender, 0); break;
                case "coin": coin(sender, args); break;
                case "rcshop": admin(sender, args); break;
                default: return false;
            }
        } catch (IllegalArgumentException | ArithmeticException ex) { msg(sender, "&c" + (ex.getMessage() == null ? "Invalid number." : ex.getMessage())); }
        catch (IllegalStateException ex) { getLogger().severe(ex.getMessage()); msg(sender, "&cCould not save data; contact an administrator."); }
        return true;
    }

    private void coin(CommandSender s, String[] a) {
        String action = a.length == 0 ? "balance" : normalize(a[0]);
        if (action.equals("balance")) {
            if (!allowed(s, "recoinshop.balance")) return;
            if (a.length > 3) throw new IllegalArgumentException("Usage: /coin balance [player] [currency]");
            OfflinePlayer target = a.length > 1 ? player(a[1]) : (s instanceof Player ? (Player)s : null);
            if (target == null) throw new IllegalArgumentException("Specify a player.");
            String currency = a.length > 2 ? normalize(a[2]) : defaultCurrency();
            requireCurrency(currency);
            msg(s, "&e" + target.getName() + ": " + currencies.getString("currencies." + currency + ".symbol", "") + balance(target.getUniqueId(), currency) + " " + currencyName(currency));
            return;
        }
        if (!Arrays.asList("give", "take", "set", "pay").contains(action) || a.length < 3 || a.length > 4)
            throw new IllegalArgumentException("Usage: /coin <balance|give|take|set|pay> [player] [amount] [currency]");
        if (!allowed(s, action.equals("pay") ? "recoinshop.pay" : "recoinshop.admin")) return;
        OfflinePlayer target = player(a[1]);
        long amount = number(a[2], action.equals("set"));
        String currency = a.length == 4 ? normalize(a[3]) : defaultCurrency();
        requireCurrency(currency);
        long old = balance(target.getUniqueId(), currency), value;
        if (action.equals("pay")) {
            if (!(s instanceof Player)) throw new IllegalArgumentException("Only players can pay.");
            UUID from = ((Player)s).getUniqueId();
            if (from.equals(target.getUniqueId())) throw new IllegalArgumentException("You cannot pay yourself.");
            long source = balance(from, currency);
            if (source < amount) throw new IllegalArgumentException("Insufficient balance.");
            value = Math.addExact(old, amount);
            balance(from, currency, source - amount);
        } else if (action.equals("give")) value = Math.addExact(old, amount);
        else if (action.equals("take")) {
            if (old < amount) throw new IllegalArgumentException("That player has insufficient balance.");
            value = old - amount;
        } else value = amount;
        balance(target.getUniqueId(), currency, value); saveBalances();
        msg(s, "&a" + action + " completed: " + amount + " " + currencyName(currency) + " for " + target.getName() + ".");
        if (action.equals("pay") && target.isOnline()) msg(target.getPlayer(), "&aReceived " + amount + " " + currencyName(currency) + " from " + s.getName() + ".");
    }
    private void requireCurrency(String id) { if (!currencyIds().contains(id)) throw new IllegalArgumentException("Unknown currency: " + id); }
    private YamlConfiguration requireMenu(String id) {
        YamlConfiguration menu = menus.get(id);
        if (menu == null) throw new IllegalArgumentException("Unknown menu: " + id);
        return menu;
    }

    private void admin(CommandSender s, String[] a) {
        if (a.length < 2) throw new IllegalArgumentException("Usage: /rcshop <menu|item|currency> <action>");
        String type = normalize(a[0]), action = normalize(a[1]);
        if (type.equals("menu")) menuCommand(s, action, a);
        else if (type.equals("currency")) currencyCommand(s, action, a);
        else if (type.equals("item")) itemCommand(s, action, a);
        else throw new IllegalArgumentException("Unknown management category.");
    }
    private void menuCommand(CommandSender s, String action, String[] a) {
        if (action.equals("list")) { msg(s, "&eMenus: " + String.join(", ", menus.keySet())); return; }
        if (action.equals("create")) {
            if (!allowed(s, "recoinshop.menu.create")) return;
            if (a.length != 5 || !a[3].equalsIgnoreCase("slot") || !a[2].matches("[1-6][a-zA-Z0-9_-]{1,64}")) throw new IllegalArgumentException("Usage: /rcshop menu create <rows><menu_name> slot <slot>");
            int rows = a[2].charAt(0) - '0'; String id = normalize(a[2].substring(1)); int position = slot(a[4]);
            if (menus.containsKey(id)) throw new IllegalArgumentException("Menu already exists.");
            ensureMenuSlot(position, null);
            YamlConfiguration menu = new YamlConfiguration();
            menu.set("title", "&6" + id); menu.set("rows", rows); menu.set("slot", position); menu.set("icon", "CHEST");
            menus.put(id, menu); saveMenu(id); msg(s, "&aCreated menu " + id + "."); return;
        }
        if (a.length < 3) throw new IllegalArgumentException("Specify a menu name.");
        String id = normalize(a[2]); YamlConfiguration menu = requireMenu(id);
        if (action.equals("open")) {
            if (!(s instanceof Player)) throw new IllegalArgumentException("Only players can open menus.");
            openMenu((Player)s, id, 0); return;
        }
        if (action.equals("delete")) {
            if (!allowed(s, "recoinshop.menu.delete")) return;
            if (a.length != 3) throw new IllegalArgumentException("Usage: /rcshop menu delete <menu>");
            if (!new File(menuDir, id + ".yml").delete()) throw new IllegalStateException("Could not delete menu " + id);
            menus.remove(id); msg(s, "&aDeleted menu " + id + "."); return;
        }