Wlajfh Shdhdhd

Create a fully configurable /shop using PlayerPoints, starting with a main GUI where players can select categories such as Food, which open separate configurable GUIs. Each GUI should support configurable titles, row counts, items, slots, multiple lore lines, hex/legacy colors, prices, and item amounts. Clicking an item should check and remove the required PlayerPoints, then give the item with no purchase cooldown. Add a separate Premium Shop that requires a configurable permission to access. All messages, sounds, prices, items, permissions, and GUI settings should be configurable.

Kodari AI
KodariSep 28 at 4:39 am 1
PlayerPointShop
Creates a fully configurable PlayerPoints-based shop system with a main category GUI and separate sub-GUIs for each category like Food. Each GUI supports configurable titles, row counts, item slots, multiple lore lines, hex/legacy colors, prices, and item amounts. Clicking an item checks and deducts the required PlayerPoints, then grants the item without cooldown. Includes a Premium Shop requiring a configurable permission. All messages, sounds, prices, items, permissions, and GUI settings are configurable via YAML configuration files.
  1. Build the plugin entry point and register /shop.

  2. Add configurable category/premium inventories and point-based purchases.

  3. Add defaults for messages, sounds, permissions, item details, and GUI layouts.

Created the configurable PlayerPoints shop with /shop, category GUIs, and a permission-gated /premiumshop. GUI layouts, items, amounts, prices, lore, messages, sounds, and hex/legacy colors are configurable in config.yml; purchases deduct points and deliver items without a cooldown.

Wlajfh Shdhdhd

add a next page and previuous page button when clicking a section and on the first page insteaf of a previous page make a it a back button which takes you to the main menu make the lore configurable with mutlipe lines

Kodari AI
KodariSep 28 at 4:41 am 1
  1. Add page navigation to category and premium shop inventories, reserving configurable navigation slots.

  2. Use a back button on page one and previous-page buttons afterward; add configurable multi-line lore for each control.

Added pagination to category and Premium Shop GUIs. The first page shows a configurable back button that returns to the main menu; later pages show a configurable previous-page button, and the next-page button appears when more items remain.

Navigation buttons support configurable materials, names, slots, and multi-line lore in config.yml, including %page% and %pages% placeholders. Existing item lore also supports multiple lines.

Wlajfh Shdhdhd

messages: player-only: '&cOnly players can use this command.' no-permission: '&cYou do not have permission to access the Premium Shop.' insufficient-points: '&cYou need %price% points, but you only have %balance%.' purchase: '&aPurchased %amount%x %item% for %price% points.' invalid-item: '&cThis shop item is unavailable. Please contact an administrator.'

sounds: open: UI_BUTTON_CLICK purchase: ENTITY_PLAYER_LEVELUP insufficient: BLOCK_NOTE_BLOCK_BASS denied: BLOCK_NOTE_BLOCK_BASS

pagination: previous: slot: 18 material: ARROW amount: 1 name: '&ePrevious Page' lore: - '&7Go to page %page% of %pages%.' - '&7Click to browse the previous page.' next: slot: 26 material: ARROW amount: 1 name: '&eNext Page' lore: - '&7Go to page %page% of %pages%.' - '&7Click to browse the next page.' back: slot: 18 material: BARRIER amount: 1 name: '&cBack to Shop' lore: - '&7Return to the main shop menu.' - '&7Your current page is %page%.'

main: title: '&8▶ Shop | Dashboard' rows: 3

categories: food: icon: slot: 11 material: BREAD amount: 1 name: '&e&lFOOD' lore: - '&7[ᴅᴇѕᴄʀɪᴘᴛɪᴏɴ]' - '' - '&einformation' - '&e| &fclick here, to open' - '&e| &fthis shop category!' - '' - '&e▶ &l&nCLICK&r &eto open' shop: title: '&8Food Shop' rows: 3 items: steak: slot: 11 material: COOKED_BEEF amount: 16 price: 25 name: '&cSteak' lore: - '&7A stack of cooked steak.' - '&7Price: &e%price% points' golden_carrot: slot: 15 material: GOLDEN_CARROT amount: 8 price: 40 name: '&6Golden Carrot' lore: - '&7A tasty snack.' - '&7Price: &e%price% points'

mace: icon: slot: 12 material: MACE amount: 1 name: '&e&lMACE' lore: - '&7[ᴅᴇѕᴄʀɪᴘᴛɪᴏɴ]' - '' - '&einformation' - '&e| &fclick here, to open' - '&e| &fthis shop category!' - '' - '&e▶ &l&nCLICK&r &eto open' shop: title: '&8mace Shop' rows: 3 items: oak_logs: slot: 11 material: OAK_LOG amount: 16 price: 20 name: '&6Oak Logs' lore: - '&7A bundle of oak logs.' - '&7Price: &e%price% points'

potions: icon: slot: 14 material: POTION amount: 1 name: '&e&lPOTIONS' lore: - '&7[ᴅᴇѕᴄʀɪᴘᴛɪᴏɴ]' - '' - '&einformation' - '&e| &fclick here, to open' - '&e| &fthis shop category!' - '' - '&e▶ &l&nCLICK&r &eto open' shop: title: '&8Potion Shop' rows: 3 items: oak_logs: slot: 11 material: OAK_LOG amount: 16 price: 20 name: '&6Oak Logs' lore: - '&7A bundle of oak logs.' - '&7Price: &e%price% points' utils: icon: slot: 15 material: FISHING_ROD amount: 1 name: '&e&lUTILITES' lore: - '&7[ᴅᴇѕᴄʀɪᴘᴛɪᴏɴ]' - '' - '&einformation' - '&e| &fclick here, to open' - '&e| &fthis shop category!' - '' - '&e▶ &l&nCLICK&r &eto open' shop: title: '&8utils' rows: 3 items: oak_logs: slot: 11 material: OAK_LOG amount: 16 price: 20 name: '&6Oak Logs' lore: - '&7A bundle of oak logs.' - '&7Price: &e%price% points' make this the defualt config allow potions differnet effects of the potions and enchants on items

Kodari AI
KodariSep 28 at 4:56 am 1
  1. Replace the default YAML with the shop layout and text you provided.

  2. Add configurable potion effects and enchantments to purchasable items.

Updated the default config with your Food, Mace, Potions, and Utilities categories, while retaining the Premium Shop settings. Added configurable potion effects and item enchantments, with sample Speed and Healing potions and an enchanted fishing rod.

Use potion-effects keyed by effect name, with duration in ticks and level starting at 1; use enchantments keyed by enchantment name with its level.

Wlajfh Shdhdhd

It says the economy is not avibe I just want it to use player points plugin that economy and make this the default configuration

📎 1 file 2,333 chars
📄
pasted-code-1791056241168.txt
txt 61 lines
▶
============================================================
#  CoinsPay - configuration
#
#  Colours:
#    &a, &l, ...        legacy colour codes
#    &#FFD700           hex colour (with the & prefix)
#    #FFD700            hex colour (bare)
#    &x&f&f&d&7&0&0     native Spigot hex format
#
#  Placeholders:
#    %prefix%    the prefix defined below
#    %player%    the other player (receiver in "sent", sender in "received")
#    %sender%    the player who sent the coins
#    %receiver%  the player who received the coins
#    %amount%    the number of coins transferred
#    %balance%   the balance of the player reading the message
# ============================================================

prefix: "&e ⛃ &lCOINS &7▷ &r"

messages:

  # Feedback for the player who SENT the coins.
  sent:
    chat:
      - "%prefix%&fYou sent &e%amount% &ecoins &fto &e%player%&f."
      - "%prefix%&7Your new balance: &e%balance%"
    hotbar: "&e ⛃ &lCOINS &7▷ &fYou sent &e%amount% &ecoins &fto &e%player%&f"
    sound:
      enabled: true
      # Any Bukkit Sound enum constant, e.g. ENTITY_EXPERIENCE_ORB_PICKUP.
      name: ENTITY_EXPERIENCE_ORB_PICKUP
      volume: 1.0
      pitch: 1.5

  # Feedback for the player who RECEIVED the coins.
  received:
    chat:
      - "%prefix%&fYou received &e%amount% &ecoins &ffrom &e%player%&f."
      - "%prefix%&7Your new balance: &e%balance%"
    hotbar: "&e ⛃ &lCOINS &7▷ &fYou received &e%amount% &ecoins &ffrom &e%player%&f"
    sound:
      enabled: true
      name: ENTITY_PLAYER_LEVELUP
      volume: 1.0
      pitch: 1.5

  # Error / informational messages.
  errors:
    player-only: "%prefix%&cOnly players can use this command."
    no-permission: "%prefix%&cYou do not have permission to do that."
    usage: "%prefix%&cUsage: &e/%label%  "
    player-not-found: "%prefix%&cPlayer &e%player% &cis not online."
    self-pay: "%prefix%&cYou cannot send coins to yourself."
    invalid-amount: "%prefix%&cInvalid amount. Please enter a whole number above 0."
    not-enough-points: "%prefix%&cYou do not have enough coins. Your balance is &e%balance%&c."
    transfer-failed: "%prefix%&cThe transfer failed. No coins were taken."
    economy-unavailable: "%prefix%&cThe coin economy is not available right now."
    reloaded: "%prefix%&aConfiguration reloaded."

Kodari AI
KodariOct 3 at 7:38 pm 1

The shop already uses PlayerPoints directly: it gets the PlayerPoints API and checks/deducts points with look() and take(). It does not use Vault or a separate economy provider, and the plugin declares PlayerPoints as a required dependency.

The attached YAML is a CoinsPay configuration, not a shop configuration; it lacks the shop’s main, categories, and item settings, so using it as config.yml would break the shop layout. I also don’t see an “economy unavailable” message in this project. Share the exact in-game message or console error and I can trace what’s producing it.

Wlajfh Shdhdhd

Make the command able to change so remove /shop or like have a command: /shop or command: /shellshop

Kodari AI
KodariOct 11 at 6:49 pm 1
  • Add command: shop as the configurable main command, accepting either shop or shellshop (with or without /).

  • Register both labels; only the configured one opens the main shop, and the other directs players to the configured command.

Set command: shellshop in config.yml to use /shellshop, or command: shop for /shop. The other command will no longer open the shop and will direct players to the configured command. Both command labels are declared in plugin.yml; restart the plugin after changing the setting.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
4 654
src/main/java/com/kodari/pointsshop/PointsShopPlugin.java
package com.kodari.pointsshop;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XEnchantment;
import com.cryptomorin.xseries.XPotion;
import com.cryptomorin.xseries.XSound;
import org.black_ixx.playerpoints.PlayerPoints;
import org.black_ixx.playerpoints.PlayerPointsAPI;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
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.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Consumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public final class PointsShopPlugin extends JavaPlugin implements Listener, CommandExecutor {
    private static final Pattern HEX_COLOR = Pattern.compile("(?i)(?:&#|<#)([0-9a-f]{6})>?");
    private final Map<Inventory, Map<Integer, Consumer<Player>>> openMenus = new HashMap<>();
    private PlayerPointsAPI pointsApi;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        pointsApi = PlayerPoints.getInstance().getAPI();
        Bukkit.getPluginManager().registerEvents(this, this);
        getCommand("shop").setExecutor(this);
        getCommand("shellshop").setExecutor(this);
        getCommand("premiumshop").setExecutor(this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage(message("player-only"));
            return true;
        }

        if (command.getName().equalsIgnoreCase("premiumshop")) {
            openPremiumShop(player);
        } else if (command.getName().equalsIgnoreCase(configuredShopCommand())) {
            openMainShop(player);
        } else {
            player.sendMessage(color(applyPlaceholders(
                    getConfig().getString("messages.command-use", "&cUse /%command% to open the shop."),
                    Map.of("%command%", configuredShopCommand()))));
        }
        return true;
    }

    private String configuredShopCommand() {
        String configured = getConfig().getString("command", "shop");
        if (configured == null || configured.isBlank()) {
            return "shop";
        }
        return configured.trim().replaceFirst("^/", "");
    }

    private void openMainShop(Player player) {
        int rows = rows(getConfig().getInt("main.rows", 3));
        Inventory inventory = Bukkit.createInventory(null, rows * 9, color(getConfig().getString("main.title", "&8Points Shop")));
        Map<Integer, Consumer<Player>> actions = new HashMap<>();

        var categories = getConfig().getConfigurationSection("categories");
        if (categories != null) {
            for (String key : categories.getKeys(false)) {
                String path = "categories." + key + ".icon";
                var iconSection = getConfig().getConfigurationSection(path);
                if (iconSection == null) {
                    continue;
                }
                int slot = iconSection.getInt("slot", -1);
                ItemStack icon = createItem(iconSection, Map.of());
                if (!validSlot(slot, rows) || icon == null) {
                    continue;
                }
                inventory.setItem(slot, icon);
                actions.put(slot, clicker -> openCategory(clicker, key));
            }
        }

        var premiumButton = getConfig().getConfigurationSection("premium.button");
        if (premiumButton != null) {
            int slot = premiumButton.getInt("slot", -1);
            ItemStack icon = createItem(premiumButton, Map.of());
            if (validSlot(slot, rows) && icon != null) {
                inventory.setItem(slot, icon);
                actions.put(slot, this::openPremiumShop);
            }
        }

        openMenu(player, inventory, actions);
    }

    private void openCategory(Player player, String category) {
        var shop = getConfig().getConfigurationSection("categories." + category + ".shop");
        if (shop != null) {
            openShop(player, shop, 0);
        }
    }

    private void openPremiumShop(Player player) {
        String permission = getConfig().getString("premium.permission", "pointsshop.premium");
        if (permission != null && !permission.isBlank() && !player.hasPermission(permission)) {
            sendMessage(player, "no-permission", Map.of());
            playSound(player, "denied");
            return;
        }

        var shop = getConfig().getConfigurationSection("premium");
        if (shop != null) {
            openShop(player, shop, 0);
        }
    }

    private void openShop(Player player, org.bukkit.configuration.ConfigurationSection shop, int requestedPage) {
        int rows = rows(shop.getInt("rows", 3));
        Inventory inventory = Bukkit.createInventory(null, rows * 9, color(shop.getString("title", "&8Shop")));
        Map<Integer, Consumer<Player>> actions = new HashMap<>();
        var pagination = getConfig().getConfigurationSection("pagination");
        var previousButton = pagination == null ? null : pagination.getConfigurationSection("previous");
        var nextButton = pagination == null ? null : pagination.getConfigurationSection("next");
        var backButton = pagination == null ? null : pagination.getConfigurationSection("back");
        int previousSlot = previousButton == null ? -1 : previousButton.getInt("slot", -1);
        int nextSlot = nextButton == null ? -1 : nextButton.getInt("slot", -1);
        Set<Integer> navigationSlots = new HashSet<>();
        if (validSlot(previousSlot, rows)) {
            navigationSlots.add(previousSlot);
        }
        if (validSlot(nextSlot, rows)) {
            navigationSlots.add(nextSlot);
        }

        List<org.bukkit.configuration.ConfigurationSection> availableItems = new ArrayList<>();
        var items = shop.getConfigurationSection("items");
        if (items != null) {
            for (String key : items.getKeys(false)) {
                var item = items.getConfigurationSection(key);
                if (item == null) {
                    continue;
                }
                int slot = item.getInt("slot", -1);
                if (validSlot(slot, rows) && !navigationSlots.contains(slot)) {
                    availableItems.add(item);
                }
            }
        }

        int pageSize = Math.max(1, rows * 9 - navigationSlots.size());
        int pages = Math.max(1, (availableItems.size() + pageSize - 1) / pageSize);
        int page = Math.max(0, Math.min(requestedPage, pages - 1));
        int start = page * pageSize;
        int end = Math.min(start + pageSize, availableItems.size());
        for (int index = start; index < end; index++) {
            org.bukkit.configuration.ConfigurationSection item = availableItems.get(index);
            int slot = item.getInt("slot", -1);
            int price = Math.max(0, item.getInt("price", 0));
            int amount = Math.max(1, item.getInt("amount", 1));
            String name = item.getString("name", item.getString("material", "item"));
            ItemStack icon = createItem(item, placeholders(price, amount, name, pointsApi.look(player.getUniqueId())));
            if (icon == null) {
                continue;
            }
            inventory.setItem(slot, icon);
            actions.put(slot, clicker -> purchase(clicker, item, price, amount, name));
        }

        if (page == 0) {
            addNavigationButton(inventory, actions, backButton, previousSlot, rows,
                    Map.of("%page%", "1", "%pages%", String.valueOf(pages)), this::openMainShop);
        } else {
            int previousPage = page - 1;
            addNavigationButton(inventory, actions, previousButton, previousSlot, rows,
                    Map.of("%page%", String.valueOf(previousPage + 1), "%pages%", String.valueOf(pages)),
                    clicker -> openShop(clicker, shop, previousPage));
        }
        if (page < pages - 1) {
            int nextPage = page + 1;
            addNavigationButton(inventory, actions, nextButton, nextSlot, rows,
                    Map.of("%page%", String.valueOf(nextPage + 1), "%pages%", String.valueOf(pages)),