vel.taitcloud

AuraShop — AuraVerseMC Custom Economy Shop Plugin

Develop a complete, production-ready Minecraft plugin named AuraShop for AuraVerseMC, inspired by Donut SMP and Flash Shop.

  1. Paper 26.2 Compatibility — CRITICAL
  • Target my server's Paper 26.2 build.
  • First verify what Minecraft version the installed Paper 26.2 build actually supports.
  • Check the official Paper documentation and available Maven artifacts to determine the correct Paper API dependency, Java version, and compiler target.
  • Do not assume that “Paper 26.2” automatically means Minecraft 1.26.2.
  • Use the exact compatible Paper API version in "pom.xml".
  • Ensure the finished plugin compiles and runs on my actual server build without unsupported API calls.
  • Avoid NMS, reflection-based hacks, and unnecessary dependencies.
  • If the exact Paper 26.2 API is unavailable, clearly explain the limitation and use only a verified compatible API. Do not falsely claim compatibility.
  1. Core Features

Create a professional category-based inventory shop with item icons, names, buy prices, quantities, pagination, and configurable GUI layouts.

Use VaultAPI with the existing EssentialsX Economy provider.

BUY ONLY: UltimateDonutSMP2 already handles selling. Never implement or interfere with any selling functionality.

Never register or override "/shop".

  1. Commands
  • "/sh" — Open the AuraShop category GUI.
  • "/shop:aura" — Open the same GUI.
  • "/acshop" — Open the same GUI.
  • "/aurashop reload" — Safely reload configuration files.
  • "/aurashop version" — Display plugin version and dependency status.

Preserve existing commands and aliases from other plugins.

  1. Main Categories

Create separate clickable category inventories:

Category| Icon Blocks| GRASS_BLOCK Ores & Minerals| DIAMOND Farming| WHEAT Food| GOLDEN_CARROT Mob Drops| ROTTEN_FLESH Nether| NETHERRACK End| END_STONE Building| BRICKS Redstone| REDSTONE Tools| DIAMOND_PICKAXE Combat| DIAMOND_SWORD Miscellaneous| CHEST

Include configurable titles, sizes, slots, borders, sounds, back/close buttons, and next/previous-page buttons. Item lore must display names, quantities, and prices.

  1. Default Item Catalog and Prices

Use these editable illustrative AuraVerseMC prices, not claimed Donut SMP prices.

Blocks: Cobblestone ×16 — $8; Stone ×16 — $12; Dirt ×16 — $8; Sand ×16 — $16; Gravel ×16 — $12; Oak Log ×16 — $32; Glass ×16 — $24; Obsidian ×1 — $100.

Ores & Minerals: Coal ×1 — $8; Raw Iron ×1 — $20; Iron Ingot ×1 — $32; Raw Gold ×1 — $28; Gold Ingot ×1 — $40; Diamond ×1 — $250; Emerald ×1 — $200; Lapis Lazuli ×1 — $12; Redstone Dust ×1 — $10; Netherite Ingot ×1 — $10,000.

Farming: Wheat ×16 — $24; Carrot ×16 — $24; Potato ×16 — $24; Sugar Cane ×16 — $32; Pumpkin ×1 — $20; Melon ×1 — $12; Cactus ×16 — $24; Bamboo ×16 — $16.

Food: Bread ×1 — $12; Cooked Beef ×1 — $24; Golden Carrot ×1 — $40; Apple ×1 — $10; Cooked Chicken ×1 — $16.

Mob Drops: Rotten Flesh ×16 — $16; Bone ×16 — $32; String ×16 — $40; Gunpowder ×1 — $40; Ender Pearl ×1 — $80; Blaze Rod ×1 — $100; Slime Ball ×1 — $50.

Nether & End: Netherrack ×16 — $16; Quartz ×16 — $48; Glowstone Dust ×16 — $40; Magma Cream ×1 — $60; End Stone ×16 — $32; Chorus Fruit ×16 — $48.

Redstone: Repeater ×1 — $40; Comparator ×1 — $50; Hopper ×1 — $150; Piston ×1 — $60; Sticky Piston ×1 — $100; Observer ×1 — $80; Dispenser ×1 — $50.

Tools & Combat: Iron Pickaxe ×1 — $150; Diamond Pickaxe ×1 — $1,000; Diamond Sword ×1 — $800; Shield ×1 — $100; Bow ×1 — $150; Arrow ×16 — $32; Golden Apple ×1 — $250.

Add useful survival items as appropriate. All prices, quantities, and materials must remain configurable.

  1. Purchase GUI
  • Left-click to purchase the configured quantity.
  • Right-click to select a quantity.
  • Support quantities of 1, 8, 16, 32, and 64 within material stack limits.
  • Show the total purchase cost before confirmation.
  • Prevent players from taking GUI items.
  • Securely handle shift-clicks, number-key swaps, double-clicks, dragging, off-hand swaps, and other inventory exploits.
  • Validate all purchase details server-side.
  1. Economy and Transaction Safety
  • Use VaultAPI with the existing economy provider.
  • Support EssentialsX Economy through Vault.
  • Never create a separate economy.
  • Check balance and inventory space before purchases.
  • Withdraw the correct total and deliver items only after successful payment.
  • Handle failed withdrawals, invalid prices, insufficient funds, and full inventories safely.
  • Prevent duplicate payments, item duplication, and inconsistent transactions.
  • Ensure displayed prices always match actual charges.
  1. UltimateDonutSMP2 Compatibility

This is mandatory:

  • Implement BUY functionality only.
  • Do not add sell commands, sell GUIs, sell buttons, sell prices, or sell mechanics.
  • Never modify UltimateDonutSMP2 files, configuration, commands, or behavior.
  • Do not interfere with its existing selling system.
  • Never register or override "/shop".
  • Use the same Vault economy balance without creating a duplicate economy.
  1. Permissions
  • "aurashop.use" — Access the shop.
  • "aurashop.admin" — Reload configurations and view plugin information.
  • Support LuckPerms without requiring it as a dependency.
  1. Required Configuration Files

Generate:

  • "config.yml" — General settings, GUI design, currency display, and permissions.
  • "categories.yml" — Categories, icons, slots, and descriptions.
  • "items.yml" — Materials, categories, quantities, and buy prices.
  • "messages.yml" — Customizable messages.

Validate configuration on startup and reload safely using "/aurashop reload".

  1. Complete Project Delivery

Provide:

  • Complete Java source code.
  • Correct "pom.xml" with the verified Paper API and Vault dependencies.
  • "plugin.yml" with correct command declarations and permissions.
  • All configuration files with working default values.
  • README with prerequisites, build instructions, installation, and troubleshooting.
  • A complete Maven project that compiles successfully.

Before delivery, verify dependency compatibility, command conflicts, transaction safety, inventory protection, and configuration loading. Do not provide pseudocode or incomplete snippets.

Final Acceptance Criteria

  1. Compatible with my actual Paper 26.2 server build.
  2. "/sh", "/shop:aura", and "/acshop" open AuraShop.
  3. "/shop" remains untouched.
  4. Every category and configured item works.
  5. Purchases use the existing Vault economy safely.
  6. UltimateDonutSMP2 selling remains unchanged.
  7. All prices and GUI settings are configurable.
  8. The project builds successfully with clear errors for missing dependencies.

Deliver a complete, tested, buildable AuraShop project for AuraVerseMC. Prioritize actual Paper 26.2 compatibility over assumptions about Minecraft or Java versions.

Kodari AI
KodariOct 25 at 5:29 am 3
AuraShop
A category-based buy-only shop plugin for AuraVerseMC that integrates with Vault and EssentialsX economy. Features configurable GUI with 12 categories, paginated item listings, purchase quantity selection, and secure transaction handling. Commands include /sh, /shop:aura, /acshop for opening the shop and /aurashop for admin functions. Implements buy-only functionality to avoid conflicts with UltimateDonutSMP2's selling system. Includes full configuration files for categories, items, messages, and GUI settings with reload support.
  1. Verify what Paper 26.2 supports and the matching official API/Java requirements.

  2. Create AuraShop’s Maven project, plugin commands, configuration, purchase GUIs, and documentation using only verified compatibility.

Created the AuraShop Maven project with its Java source, plugin.yml, all four default configuration files, and README.

  • Compatibility: Paper’s official version endpoint lists Paper 26.2 as supported through build 134, with Java 25 minimum. The project pins paper-api:26.2.build.134-stable and Java release 25. The installed server jar wasn’t available, so its exact build couldn’t be checked.

  • Shop behavior: /sh, /acshop, and the exact /shop:aura route open the category shop. AuraShop does not register /shop and includes no selling functionality.

  • Purchases: Uses Vault’s registered economy provider, validates inventory space and purchase details, and protects shop inventories against item movement and click exploits.

  • Configuration and commands: Includes the requested catalog and settings, plus /aurashop reload and /aurashop version. Invalid reloads retain the previous valid configuration.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
Code
13 1,494
src/main/java/com/auraversemc/aurashop/AuraShopPlugin.java
package com.auraversemc.aurashop;

import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

public final class AuraShopPlugin extends JavaPlugin {
    private static final List<String> CONFIG_FILES = List.of("config.yml", "categories.yml", "items.yml", "messages.yml");

    private YamlConfiguration settings;
    private YamlConfiguration categorySettings;
    private YamlConfiguration itemSettings;
    private YamlConfiguration messages;
    private Map<String, ShopCategory> categories = Map.of();
    private Map<String, ShopListing> listings = Map.of();
    private Economy economy;
    private ShopMenus menus;
    private final Set<UUID> purchasing = ConcurrentHashMap.newKeySet();

    @Override
    public void onEnable() {
        if (!loadCandidate(true)) {
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            getLogger().severe("Vault is required. Install Vault and an economy provider such as EssentialsX Economy.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        RegisteredServiceProvider<Economy> registration = getServer().getServicesManager().getRegistration(Economy.class);
        if (registration == null || registration.getProvider() == null) {
            getLogger().severe("Vault is present, but no economy provider is registered. Enable EssentialsX Economy or another Vault provider.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        economy = registration.getProvider();
        menus = new ShopMenus(this);
        ShopCommand command = new ShopCommand(this);
        getCommand("sh").setExecutor(command);
        getCommand("sh").setTabCompleter(command);
        getCommand("acshop").setExecutor(command);
        getCommand("acshop").setTabCompleter(command);
        getCommand("aurashop").setExecutor(command);
        getCommand("aurashop").setTabCompleter(command);
        getServer().getPluginManager().registerEvents(new ShopListener(this, menus), this);
        getLogger().info("AuraShop enabled with Vault economy provider: " + economy.getName());
    }

    private boolean loadCandidate(boolean startup) {
        try {
            for (String resource : CONFIG_FILES) {
                File file = new File(getDataFolder(), resource);
                if (!file.exists()) {
                    saveResource(resource, false);
                }
            }

            YamlConfiguration nextSettings = loadYaml("config.yml");
            YamlConfiguration nextCategories = loadYaml("categories.yml");
            YamlConfiguration nextItems = loadYaml("items.yml");
            YamlConfiguration nextMessages = loadYaml("messages.yml");
            Map<String, ShopCategory> parsedCategories = new LinkedHashMap<>();
            Map<String, ShopListing> parsedListings = new LinkedHashMap<>();
            List<String> errors = validate(nextSettings, nextCategories, nextItems, parsedCategories, parsedListings);
            if (!errors.isEmpty()) {
                throw new IllegalArgumentException(String.join("; ", errors));
            }

            settings = nextSettings;
            categorySettings = nextCategories;
            itemSettings = nextItems;
            messages = nextMessages;
            categories = Collections.unmodifiableMap(new LinkedHashMap<>(parsedCategories));
            listings = Collections.unmodifiableMap(new LinkedHashMap<>(parsedListings));
            return true;
        } catch (IOException | InvalidConfigurationException | IllegalArgumentException exception) {
            getLogger().severe("Could not " + (startup ? "load" : "reload") + " configuration: " + exception.getMessage());
            return false;
        }
    }

    private YamlConfiguration loadYaml(String fileName) throws IOException, InvalidConfigurationException {
        YamlConfiguration yaml = new YamlConfiguration();
        yaml.load(new File(getDataFolder(), fileName));
        return yaml;
    }

    private List<String> validate(YamlConfiguration nextSettings, YamlConfiguration nextCategories,
                                  YamlConfiguration nextItems, Map<String, ShopCategory> parsedCategories,
                                  Map<String, ShopListing> parsedListings) {
        List<String> errors = new ArrayList<>();
        int categorySize = nextSettings.getInt("gui.categories.size", -1);
        int itemSize = nextSettings.getInt("gui.items.size", -1);
        int quantitySize = nextSettings.getInt("gui.quantity.size", -1);
        int confirmationSize = nextSettings.getInt("gui.confirmation.size", -1);
        validateSize("gui.categories.size", categorySize, errors);
        validateSize("gui.items.size", itemSize, errors);
        validateSize("gui.quantity.size", quantitySize, errors);
        validateSize("gui.confirmation.size", confirmationSize, errors);

        ConfigurationSection categorySection = nextCategories.getConfigurationSection("categories");
        Set<Integer> categorySlots = new HashSet<>();
        if (categorySection == null || categorySection.getKeys(false).isEmpty()) {
            errors.add("categories.yml must contain at least one category");
        } else {
            for (String id : categorySection.getKeys(false)) {
                String path = "categories." + id + ".";
                String name = nextCategories.getString(path + "name", "").trim();
                Material icon = matchMaterial(nextCategories.getString(path + "icon", ""));
                int slot = nextCategories.getInt(path + "slot", -1);
                if (name.isEmpty()) errors.add(path + "name is required");
                if (icon == null) errors.add(path + "icon is not a valid Paper material");
                if (slot < 0 || slot >= categorySize) errors.add(path + "slot must be inside the categories menu");
                else if (!categorySlots.add(slot)) errors.add(path + "slot duplicates another category slot");
                if (icon != null && slot >= 0 && slot < categorySize) {
                    parsedCategories.put(id, new ShopCategory(id, name, icon, slot,
                            nextCategories.getString(path + "description", "")));
                }
            }
        }

        ConfigurationSection itemSection = nextItems.getConfigurationSection("items");
        if (itemSection == null || itemSection.getKeys(false).isEmpty()) {
            errors.add("items.yml must contain at least one item");
        } else {
            for (String id : itemSection.getKeys(false)) {
                String path = "items." + id + ".";
                String categoryId = nextItems.getString(path + "category", "");
                String name = nextItems.getString(path + "name", "").trim();
                Material material = matchMaterial(nextItems.getString(path + "material", ""));
                int amount = nextItems.getInt(path + "quantity", -1);
                double price = nextItems.getDouble(path + "buy-price", -1);
                if (!parsedCategories.containsKey(categoryId)) errors.add(path + "category does not exist");
                if (name.isEmpty()) errors.add(path + "name is required");
                if (material == null || material.isAir()) errors.add(path + "material is not a valid buyable material");
                if (amount < 1 || amount > 64 || material != null && amount > material.getMaxStackSize()) {
                    errors.add(path + "quantity must fit in one material stack");
                }
                if (!Double.isFinite(price) || price <= 0) errors.add(path + "buy-price must be finite and greater than zero");
                if (material != null && !material.isAir() && amount >= 1 && amount <= material.getMaxStackSize()
                        && Double.isFinite(price) && price > 0 && parsedCategories.containsKey(categoryId) && !name.isEmpty()) {
                    parsedListings.put(id, new ShopListing(id, categoryId, name, material, amount,
                            new BigDecimal(Double.toString(price))));
                }
            }
        }

        validateMaterial(nextSettings.getString("gui.border.material", ""), "gui.border.material", errors);
        validateMaterial(nextSettings.getString("gui.buttons.back.material", ""), "gui.buttons.back.material", errors);
        validateMaterial(nextSettings.getString("gui.buttons.close.material", ""), "gui.buttons.close.material", errors);
        validateMaterial(nextSettings.getString("gui.buttons.previous.material", ""), "gui.buttons.previous.material", errors);
        validateMaterial(nextSettings.getString("gui.buttons.next.material", ""), "gui.buttons.next.material", errors);
        validateMaterial(nextSettings.getString("gui.buttons.confirm.material", ""), "gui.buttons.confirm.material", errors);
        validateMaterial(nextSettings.getString("gui.buttons.cancel.material", ""), "gui.buttons.cancel.material", errors);
        int categoryClose = nextSettings.getInt("gui.buttons.close-slot", -1);
        validateMenuSlots(categorySize, "gui.categories", List.of(categoryClose), errors);
        if (categorySlots.contains(categoryClose)) errors.add("a category slot conflicts with the categories close button");

        List<Integer> itemContentSlots = nextSettings.getIntegerList("gui.items.content-slots");
        List<Integer> itemControls = List.of(nextSettings.getInt("gui.buttons.back-slot", -1),
                nextSettings.getInt("gui.buttons.previous-slot", -1), categoryClose,
                nextSettings.getInt("gui.buttons.next-slot", -1));
        validateSlots(itemContentSlots, itemSize, "gui.items.content-slots", errors);
        validateMenuSlots(itemSize, "gui.items", itemControls, errors);
        if (itemContentSlots.stream().anyMatch(itemControls::contains)) errors.add("gui.items.content-slots overlap navigation buttons");

        List<Integer> quantityOptions = nextSettings.getIntegerList("gui.quantity.option-slots");
        List<Integer> quantityControls = List.of(nextSettings.getInt("gui.quantity.back-slot", -1),
                nextSettings.getInt("gui.quantity.close-slot", -1));
        validateSlots(quantityOptions, quantitySize, "gui.quantity.option-slots", errors);
        validateMenuSlots(quantitySize, "gui.quantity", quantityControls, errors);
        if (quantityOptions.stream().anyMatch(quantityControls::contains)) errors.add("gui.quantity.option-slots overlap navigation buttons");

        List<Integer> confirmationControls = List.of(nextSettings.getInt("gui.confirmation.item-slot", -1),