tr_risi

Create a fully working Minecraft plugin called EasyCoinShop for Minecraft 1.21.11. It should support Paper, Spigot, and Bukkit.

The plugin should have its own built-in coin system. No external economy or coin plugins should be required.

Features:

  • A default shop with an inventory GUI of 45 slots.
  • Slot 13 should contain an example section called Weapons with a Diamond Sword.
  • Add a command "/editecshop" to manage the shop.
  • Admins should be able to create, edit, and delete sections, shops, and items.
  • Allow full customization of GUI slots, shop titles, item names, lore, prices, and sections.
  • Add player coin balances with admin commands to give, remove, and check coins.
  • Save player balances and shop settings.
  • Add PlaceholderAPI support for the TAB scoreboard.
  • Provide the exact placeholder to display a player's coins, such as "%easycoinshop_coins%".
  • Make the plugin easy to configure using YAML files.
  • Include proper permissions for admin commands.
  • Make the GUI clean and professional.
  • Ensure compatibility with Minecraft 1.21.11.

Build the complete plugin and provide the ready-to-install "easycoinshop.jar" file along with the source code and configuration files.

The plugin must work independently without requiring DeluxeMenus or any other coin plugin.

Kodari AI
KodariNov 9 at 2:33 pm 3
EasyCoinShop
A standalone Bukkit/Spigot/Paper plugin for Minecraft 1.21.11 featuring a built-in coin economy system and a fully customizable GUI shop. Admins can create, edit, and delete shops, sections, and items with full control over slots, titles, names, lore, and prices via YAML configuration. Includes player coin balance management commands, persistent data storage, PlaceholderAPI integration for displaying coin balances, and a professional 45-slot default shop interface. No external economy or menu plugins required.
  • Build the standalone coin economy and YAML-backed shop/balance storage.

  • Add player shop GUIs plus admin commands for shop, section, item, and balance management.

  • Register optional PlaceholderAPI support and document the %easycoinshop_coins% placeholder.

EasyCoinShop is implemented as a standalone Java plugin with a built-in coin balance system, YAML persistence, and a 45-slot default shop. Slot 13 opens the Weapons section, which contains a purchasable Diamond Sword.

  • Open the shop with /coinshop [shop]; view your balance with /coins.

  • Administer balances with /coins give <player> <amount>, /coins remove <player> <amount>, and /coins check <player>.

  • Manage shops, sections, and items with /editecshop help. Titles, slots, materials, names, lore, prices, and sizes are configurable; lore commands use | between lines.

  • Configure messages in config.yml and shops in shops.yml. Player balances are saved in coins.yml.

  • Optional PlaceholderAPI integration provides %easycoinshop_coins%. The plugin does not require PlaceholderAPI or any external economy plugin for its core features.

  • Admin commands require easycoinshop.admin; opening the shop requires easycoinshop.use.

The Gradle output is configured as easycoinshop.jar. To download it, click Compile in the top bar (on phone: ⋮ → Compile Project), click Compile in the window, then Download on the successful build. Install the jar in your server’s plugins folder.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
15 1,133
src/main/java/com/kodari/easycoinshop/EasyCoinShopPlugin.java
package com.kodari.easycoinshop;

import com.kodari.easycoinshop.command.CoinShopCommand;
import com.kodari.easycoinshop.command.CoinsCommand;
import com.kodari.easycoinshop.command.EditShopCommand;
import com.kodari.easycoinshop.economy.CoinManager;
import com.kodari.easycoinshop.hook.CoinsPlaceholderExpansion;
import com.kodari.easycoinshop.shop.ShopListener;
import com.kodari.easycoinshop.shop.ShopManager;
import com.kodari.easycoinshop.shop.ShopMenu;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public final class EasyCoinShopPlugin extends JavaPlugin {
    private CoinManager coinManager;
    private ShopManager shopManager;
    private ShopMenu shopMenu;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        this.coinManager = new CoinManager(this);
        this.shopManager = new ShopManager(this);
        this.coinManager.load();
        this.shopManager.load();
        this.shopMenu = new ShopMenu(this);

        Bukkit.getPluginManager().registerEvents(new ShopListener(this), this);
        CoinShopCommand coinShopCommand = new CoinShopCommand(this);
        getCommand("coinshop").setExecutor(coinShopCommand);
        getCommand("coinshop").setTabCompleter(coinShopCommand);
        getCommand("coins").setExecutor(new CoinsCommand(this));
        getCommand("editecshop").setExecutor(new EditShopCommand(this));

        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new CoinsPlaceholderExpansion(this).register();
            getLogger().info("PlaceholderAPI hook enabled.");
        }
    }

    @Override
    public void onDisable() {
        if (coinManager != null) {
            coinManager.save();
        }
        if (shopManager != null) {
            shopManager.save();
        }
    }

    public void sendMessage(CommandSender sender, String key, String... replacements) {
        String prefix = getConfig().getString("prefix", "&8[&6EasyCoinShop&8] &r");
        String message = getConfig().getString("messages." + key, key);
        for (int i = 0; i + 1 < replacements.length; i += 2) {
            message = message.replace(replacements[i], replacements[i + 1]);
        }
        sender.sendMessage(color(prefix + message));
    }

    public String color(String text) {
        return ChatColor.translateAlternateColorCodes('&', text);
    }

    public CoinManager getCoinManager() {
        return coinManager;
    }

    public ShopManager getShopManager() {
        return shopManager;
    }

    public ShopMenu getShopMenu() {
        return shopMenu;
    }
}