Jaat G

Create a complete Minecraft Paper plugin named SehrawatShop for Minecraft Java Edition 26.2 and Paper 26.2, using Java 25 and Maven.

The plugin must be an original EconomyShopGUI-style admin shop: players open a GUI, browse categories, buy and sell configurable items, and money is handled through Vault. Do not copy EconomyShopGUI code.

Server requirements

  • Target Paper 26.2 only, not Paper 1.20.x or 1.21.x.
  • Use Java 25.
  • Use Maven with dependency: io.papermc.paper:paper-api:26.2.build.+
  • Use plugin.yml with api-version: '26.2'.
  • Integrate with Vault for economy.
  • If Vault is missing, disable buying/selling safely and print a clear console warning.
  • Make the plugin stable, lightweight, exploit-safe, and easy to edit.

Main shop

  • Command: /shop
  • Opens a main GUI showing all shop categories.
  • Each category must be configurable from its own YAML file.
  • Each category must support:

- ID - Display name - Icon material - GUI slot - Custom lore - Optional permission

  • Clicking a category opens that category’s item shop.
  • Automatically create extra pages when a category has too many items.
  • Include back, next-page, previous-page, and close buttons.
  • Cancel all clicks inside plugin GUIs to prevent item theft or duplication.

Default categories

Create these default shop files on first startup:

```text plugins/SehrawatShop/ ├── config.yml ├── messages.yml ├── gui.yml └── shops/ ├── wood.yml ├── stone.yml ├── farming.yml ├── ores.yml └── misc.yml

Kodari AI
KodariOct 24 at 7:34 pm 2
SehrawatShop
A Paper 26.2 admin shop plugin with Vault economy integration. Players open a main GUI via /shop command to browse configurable categories, each with its own YAML file defining items, prices, permissions, and GUI slots. Features automatic pagination for large categories, navigation buttons, and full click cancellation to prevent exploits. Default categories include wood, stone, farming, ores, and misc. Safely disables buying/selling if Vault is missing with clear console warnings. Built with Java 25 and Maven, featuring a lightweight event-driven GUI framework with lazy initialization for stability.
  1. Set up the Java 25 Maven project for Paper 26.2 and Vault.

  2. Implement configurable category/item shops, paginated GUIs, safe transactions, and commands.

  3. Add the default YAML files and plugin metadata.

Created SehrawatShop as a Java 25 Maven plugin targeting Paper 26.2. It includes the /shop category and paginated item GUIs, configurable YAML shops, buy/sell transactions through Vault, and click/drag protection. If Vault or an economy provider is unavailable, the shop remains accessible but transactions are disabled with a console warning.

The five default category files are in src/main/resources/shops/; configuration, messages, GUI settings, and plugin.yml are included.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
18 1,079
src/main/java/com/sehrawat/shop/SehrawatShopPlugin.java
package com.sehrawat.shop;

import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;

public final class SehrawatShopPlugin extends JavaPlugin {
    private Economy economy;
    private FileConfiguration guiConfig;
    private Messages messages;
    private ShopManager shopManager;
    private ShopMenu shopMenu;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("messages.yml", false);
        saveResource("gui.yml", false);
        File shopsDirectory = new File(getDataFolder(), "shops");
        if (!shopsDirectory.exists() && !shopsDirectory.mkdirs()) {
            getLogger().severe("Could not create the shops configuration directory.");
        }
        for (String file : new String[]{"wood.yml", "stone.yml", "farming.yml", "ores.yml", "misc.yml"}) {
            if (!new File(shopsDirectory, file).exists()) {
                saveResource("shops/" + file, false);
            }
        }

        guiConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "gui.yml"));
        messages = new Messages(new File(getDataFolder(), "messages.yml"));
        shopManager = new ShopManager(this);
        hookEconomy();
        ShopTransactions transactions = new ShopTransactions(this, economy);
        shopMenu = new ShopMenu(this, transactions);
        getServer().getPluginManager().registerEvents(shopMenu, this);
        getCommand("shop").setExecutor(new ShopCommand(this));
    }

    private void hookEconomy() {
        if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
            getLogger().warning("Vault is not installed. Shop buying and selling are disabled until Vault and an economy provider are available.");
            return;
        }
        RegisteredServiceProvider<Economy> registration = getServer().getServicesManager().getRegistration(Economy.class);
        if (registration == null || registration.getProvider() == null) {
            getLogger().warning("Vault is installed, but no economy provider is registered. Shop buying and selling are disabled.");
            return;
        }
        economy = registration.getProvider();
        getLogger().info("Connected to Vault economy provider: " + economy.getName());
    }

    public FileConfiguration getGuiConfig() {
        return guiConfig;
    }

    public Messages getMessages() {
        return messages;
    }

    public ShopManager getShopManager() {
        return shopManager;
    }

    public ShopMenu getShopMenu() {
        return shopMenu;
    }

    public String formatPrice(double amount) {
        return economy == null ? Double.toString(amount) : economy.format(amount);
    }
}