S

create a shop gui in minecraft for paper 1.21.11

Kodari AI
KodariSep 13 at 3:12 pm 1
ShopGUI
A Paper 1.21.11 Minecraft plugin that implements a GUI-based shop system using a custom inventory framework. Players can open a shop interface via command, browse purchasable items displayed as clickable buttons, and buy items with in-game currency. The plugin features a centralized GUI manager, lazy-initialized inventories, automatic event handling for clicks and closes, and a reusable button system with custom icons and lore. Supports multiple shop categories and configurable item pricing.
  1. Create the Gradle/Paper project metadata and plugin descriptor.

  2. Add a reusable inventory GUI framework with click, close, and drag handling.

  3. Add the shop command, product model, emerald currency transactions, and paginated-style product layout.

  4. Register the command and GUI listener from the main plugin class.

Created a Paper 1.21.11 emerald shop plugin.

  • /shop and /store open a 54-slot shop GUI.

  • Products are purchased using emeralds.

  • Inventory space and currency are checked before transactions.

  • Click and drag interactions are protected.

  • Includes Paper/Gradle setup, plugin descriptor, XSeries compatibility, and GUI framework.

  • Product catalog includes food, blocks, ores, diamonds, golden apples, pearls, and XP bottles.

S

it open 27 slots

Kodari AI
KodariSep 13 at 3:13 pm 1
  1. Change the shop inventory to a 27-slot GUI and fit all 14 products into its two middle rows.

Changed the shop GUI to open with 27 slots. All 14 products now fit across the two middle rows.

S

no only 5 item totem ,redstone dust ,spawner,sugar cane,golden apple and we can click on every item so we can see categori inside them

Kodari AI
KodariSep 13 at 3:16 pm 1
  1. Replace the current product grid with five category buttons: Totem, Redstone Dust, Spawner, Sugar Cane, and Golden Apple.

  2. Make each category clickable and open a separate category inventory containing its products.

  3. Preserve the 27-slot GUI, purchase handling, navigation, and protected click/drag behavior.

Implemented the 5-category shop GUI.

  • Main 27-slot GUI now shows only:

    • Totem

    • Redstone Dust

    • Spawner

    • Sugar Cane

    • Golden Apple

  • Each item is clickable and opens its own category page.

  • Added a back button to return to the category menu.

  • Added category products:

    • Redstone components

    • Totems

    • Spawners

    • Sugar cane

    • Golden apples and enchanted golden apples

  • Existing emerald purchasing and inventory protection remain enabled.

S

can u send me pic what u made

Kodari AI
KodariSep 13 at 3:17 pm 1

I can’t send a real in-game screenshot because I can’t launch a Minecraft server from here. The GUI I made is arranged like this:

Plain Text
┌─────────────────────────────────┐
│                                 │
│ [Totem] [Redstone] [Spawner]    │
│                                 │
│ [Sugar Cane] [Golden Apple]     │
│                                 │
└─────────────────────────────────┘

Each item is clickable:

  • Totem → opens the Totem category

  • Redstone Dust → opens Redstone items

  • Spawner → opens Spawner options

  • Sugar Cane → opens Sugar Cane items

  • Golden Apple → opens Golden Apple options

Inside a category, there is also a Back button to return to the main shop menu. Use /shop in-game to view it.

S

now rename totem as gear and redstone as redstone sugar cane as farm and golden apple as food

Kodari AI
KodariSep 13 at 3:18 pm 1

Renamed the shop categories:

  • Totem → Gear

  • Redstone Dust → Redstone

  • Sugar Cane → Farm

  • Golden Apple → Food

  • Spawner remains Spawner

S

and in gear shop when we click it it show totem pearl anchor glowstone obsidian crystal cnder chest arrow wind charge shulker

Kodari AI
KodariSep 13 at 3:20 pm 1
  1. Add the requested items to the Gear category: totem, pearl, anchor, glowstone, obsidian, crystal, cinder chest, arrow, wind charge, and shulker.

  2. Use version-safe XMaterial names with sensible purchase amounts and emerald prices.

  3. Keep the existing 27-slot category layout and purchase behavior unchanged.

Updated the Gear category with:

  • Totem of Undying

  • Ender Pearl

  • Respawn Anchor

  • Glowstone

  • Obsidian

  • End Crystal

  • Ender Chest

  • Arrow

  • Wind Charge

  • Shulker Box

All items are clickable and can be purchased with emeralds.

S

and in redstone when we click it shows the redstone block and dispencer dropper pistone sticky piston repeater lever observer comparitor

Kodari AI
KodariSep 13 at 3:22 pm 1
  1. Update the Redstone category to show the requested nine items.

  2. Keep the existing clickable purchase behavior, prices, and 27-slot layout unchanged.

Updated the Redstone category. It now contains:

  • Redstone Block

  • Dispenser

  • Dropper

  • Piston

  • Sticky Piston

  • Repeater

  • Lever

  • Observer

  • Comparator

Each item is clickable and purchasable with emeralds.

S

and in spawner when we click it we saw pig spawner cow spawner zombie spawner skeleton blaze iron golem spawner respectively pricsec ir as 50k 90k 120k 150k 200k 300k per each respectively

Kodari AI
KodariSep 13 at 3:23 pm 1

Updated the Spawner category with:

  • Pig Spawner — 50,000 emeralds

  • Cow Spawner — 90,000 emeralds

  • Zombie Spawner — 120,000 emeralds

  • Skeleton Spawner — 150,000 emeralds

  • Blaze Spawner — 200,000 emeralds

  • Iron Golem Spawner — 300,000 emeralds

Each spawner is clickable and purchasable from the GUI.

S

and in farm shop add the item which comes in farming and like bamboo kelp cactus sugarcane sell above 100 on bamboo and kelp and 150 on sugar cane and cactus and spawner will cost in money

Kodari AI
KodariSep 13 at 3:27 pm 1
  1. Add Bamboo, Kelp, Cactus, and Sugar Cane to the Farm category with sell values of 100/100/150/150 money per item.

  2. Change all Spawner purchases to use Vault money at the requested prices.

  3. Keep existing emerald purchasing for Gear, Redstone, and Food, with Vault handled as an optional economy provider.

Updated the shop:

  • Farm category

    • Bamboo — sells for 100 money each

    • Kelp — sells for 100 money each

    • Cactus — sells for 150 money each

    • Sugar Cane — sells for 150 money each

  • Farm items are removed from the player’s inventory when sold.

  • Spawner category now costs money:

    • Pig — 50,000

    • Cow — 90,000

    • Zombie — 120,000

    • Skeleton — 150,000

    • Blaze — 200,000

    • Iron Golem — 300,000

  • Added Vault economy support. Vault and an economy plugin such as EssentialsX are required for money transactions.

S

and in food shop add food item excep egaps only like golden apple cooked porkchop cooked beef golden caroot

Kodari AI
KodariSep 13 at 3:27 pm 1

Updated the Food shop. It now contains only:

  • Golden Apple — 12 emeralds

  • Cooked Porkchop — 2 emeralds

  • Cooked Beef — 2 emeralds

  • Golden Carrot — 2 emeralds

The Enchanted Golden Apple was removed.

S

and except i price th item u can prise it as to stable economy except the item i prises

Kodari AI
KodariSep 13 at 3:28 pm 1

Which food item and price should stay as your custom price? You haven’t specified a food price yet. Should I:

  1. Keep Golden Apple at 12 emeralds and price the other foods with money, or

  2. Change all food prices to money using balanced economy values?

S

and everything cost money

Kodari AI
KodariSep 13 at 3:28 pm 1
  1. Convert all buyable Gear, Redstone, and Food products from emeralds to Vault money.

  2. Keep Spawner purchases and Farm selling as money transactions, and rename the shop title to reflect money currency.

All shop purchases now use Vault money instead of emeralds:

  • Gear — money

  • Redstone — money

  • Spawner — money

  • Food — money

  • Farm items — sell for money

The main shop title was also changed from Emerald Shop to Money Shop.

S

and everythig u can buy in there double prise in farm and give me the chart of prises for every item

Kodari AI
KodariSep 13 at 3:30 pm 1
  1. Double the current money prices for every purchasable shop item.

  2. Leave farm selling prices unchanged unless the code shows they are also buy prices.

  3. Provide a complete price chart for all shop items.

Doubled all buy prices. Farm items remain sell-only, so their sell prices are unchanged.

Gear

Item
Amount
Price
Totem of Undying
1
$64
Ender Pearl
16
$16
Respawn Anchor
1
$48
Glowstone
16
$12
Obsidian
16
$24
End Crystal
1
$64
Ender Chest
1
$96
Arrow
16
$8
Wind Charge
16
$20
Shulker Box
1
$128

Redstone

Item
Amount
Price
Redstone Block
1
$54
Dispenser
1
$32
Dropper
1
$28
Piston
1
$24
Sticky Piston
1
$32
Repeater
1
$16
Lever
1
$8
Observer
1
$36
Comparator
1
$20

Spawners

Spawner
Price
Pig Spawner
$100,000
Cow Spawner
$180,000
Zombie Spawner
$240,000
Skeleton Spawner
$300,000
Blaze Spawner
$400,000
Iron Golem Spawner
$600,000

Food

Item
Amount
Price
Golden Apple
1
$24
Cooked Porkchop
1
$4
Cooked Beef
1
$4
Golden Carrot
1
$4

Farm selling prices

Item
Sell Price
Bamboo
$100
Kelp
$100
Cactus
$150
Sugar Cane
$150
S

totem cost 1k ender pearl cost 100 each

Kodari AI
KodariSep 13 at 3:30 pm 1
  1. Set Totem of Undying to $1,000.

  2. Set Ender Pearl to $100 per pearl by selling one pearl per purchase.

Updated the prices:

  • Totem of Undying — $1,000

  • Ender Pearl — $100 each

The shop now gives 1 Ender Pearl per purchase.

S

anchor glowstone obsidian crystal all 100 each and shulker box 5k each and wind charge and arrow cost 10 each and ender chest 100 each

Kodari AI
KodariSep 13 at 3:32 pm 1

Updated Gear shop prices, with each item sold per 1 unit:

  • Respawn Anchor — $100

  • Glowstone — $100 each

  • Obsidian — $100 each

  • End Crystal — $100

  • Ender Chest — $100

  • Arrow — $10 each

  • Wind Charge — $10 each

  • Shulker Box — $5,000 each

S

and in redstone everything cost 100 each but redstone block cast 1k each

Kodari AI
KodariSep 13 at 3:33 pm 1

Updated the Redstone shop:

  • Redstone Block — $1,000

  • Dispenser — $100

  • Dropper — $100

  • Piston — $100

  • Sticky Piston — $100

  • Repeater — $100

  • Lever — $100

  • Observer — $100

  • Comparator — $100

S

in food everthig in 100 each and in farm buy prise double sell prise same

Kodari AI
KodariSep 13 at 3:39 pm 1
  1. Set every Food item to $100 per item.

  2. Add Farm buy prices at 2× the existing sell prices, while preserving the current sell prices.

  3. Update the shop model/UI only as needed so Farm supports both buying and selling.

Updated:

Food — buy prices

Item
Price
Golden Apple
$100
Cooked Porkchop
$100
Cooked Beef
$100
Golden Carrot
$100

Farm

Item
Buy Price
Sell Price
Bamboo
$200
$100
Kelp
$200
$100
Cactus
$300
$150
Sugar Cane
$300
$150

Farm items now have separate Buy and Sell entries in the shop.

S

done how to use in aternos

Kodari AI
KodariSep 13 at 3:40 pm 1

To use the shop plugin on Aternos:

  1. Set your server software to PaperMC:

    • Aternos → Software → install PaperMC.

  2. Install the required dependencies:

    • Vault

    • An economy plugin such as EssentialsX

  3. Check Aternos → Plugins and search for this shop plugin.

    • If it is listed, install it and restart the server.

  4. Join the server and use:

Plain Text
/shop

Important

Aternos does not normally allow uploading custom plugin .jar files. If this shop plugin is not available in the Aternos plugin list, you cannot install this custom version directly there. You would need to:

  • Request the plugin to be added to Aternos, or

  • Use a host that allows custom plugin uploads, such as exaroton or a self-hosted Paper server.

The server must have a working economy provider; otherwise shop purchases and sales will not work.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
14 728
src/main/java/com/kodari/shop/ShopPlugin.java
package com.kodari.shop;

import com.cryptomorin.xseries.XMaterial;
import com.kodari.shop.gui.GUIListener;
import com.kodari.shop.gui.GUIManager;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.List;

public final class ShopPlugin extends JavaPlugin {
    private GUIManager guiManager;
    private Economy economy;

    @Override
    public void onEnable() {
        economy = setupEconomy();
        guiManager = new GUIManager();
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);

        List<ShopCategory> categories = List.of(
                category("Gear", "TOTEM_OF_UNDYING", List.of(
                        product("Totem of Undying", "TOTEM_OF_UNDYING", 1, 1_000),
                        product("Ender Pearl", "ENDER_PEARL", 1, 100),
                        product("Respawn Anchor", "RESPAWN_ANCHOR", 1, 100),
                        product("Glowstone", "GLOWSTONE", 1, 100),
                        product("Obsidian", "OBSIDIAN", 1, 100),
                        product("End Crystal", "END_CRYSTAL", 1, 100),
                        product("Ender Chest", "ENDER_CHEST", 1, 100),
                        product("Arrow", "ARROW", 1, 10),
                        product("Wind Charge", "WIND_CHARGE", 1, 10),
                        product("Shulker Box", "SHULKER_BOX", 1, 5_000)
                )),
                category("Redstone", "REDSTONE", List.of(
                        product("Redstone Block", "REDSTONE_BLOCK", 1, 1_000),
                        product("Dispenser", "DISPENSER", 1, 100),
                        product("Dropper", "DROPPER", 1, 100),
                        product("Piston", "PISTON", 1, 100),
                        product("Sticky Piston", "STICKY_PISTON", 1, 100),
                        product("Repeater", "REPEATER", 1, 100),
                        product("Lever", "LEVER", 1, 100),
                        product("Observer", "OBSERVER", 1, 100),
                        product("Comparator", "COMPARATOR", 1, 100)
                )),
                category("Spawner", "SPAWNER", List.of(
                        moneyProduct("Pig Spawner", "SPAWNER", 1, 100_000),
                        moneyProduct("Cow Spawner", "SPAWNER", 1, 180_000),
                        moneyProduct("Zombie Spawner", "SPAWNER", 1, 240_000),
                        moneyProduct("Skeleton Spawner", "SPAWNER", 1, 300_000),
                        moneyProduct("Blaze Spawner", "SPAWNER", 1, 400_000),
                        moneyProduct("Iron Golem Spawner", "SPAWNER", 1, 600_000)
                )),
                category("Farm", "SUGAR_CANE", List.of(
                        product("Bamboo", "BAMBOO", 1, 200),
                        sellProduct("Bamboo", "BAMBOO", 1, 100),
                        product("Kelp", "KELP", 1, 200),
                        sellProduct("Kelp", "KELP", 1, 100),
                        product("Cactus", "CACTUS", 1, 300),
                        sellProduct("Cactus", "CACTUS", 1, 150),
                        product("Sugar Cane", "SUGAR_CANE", 1, 300),
                        sellProduct("Sugar Cane", "SUGAR_CANE", 1, 150)
                )),
                category("Food", "GOLDEN_APPLE", List.of(
                        product("Golden Apple", "GOLDEN_APPLE", 1, 100),
                        product("Cooked Porkchop", "COOKED_PORKCHOP", 1, 100),
                        product("Cooked Beef", "COOKED_BEEF", 1, 100),
                        product("Golden Carrot", "GOLDEN_CARROT", 1, 100)
                ))
        );

        getCommand("shop").setExecutor(new ShopCommand(guiManager, categories, economy));
    }

    private ShopCategory category(String name, String material, List<ShopProduct> products) {
        XMaterial xMaterial = XMaterial.matchXMaterial(material)
                .orElseThrow(() -> new IllegalStateException("Unknown shop category material: " + material));
        return new ShopCategory(name, xMaterial, products);
    }

    private ShopProduct product(String name, String material, int amount, int price) {
        XMaterial xMaterial = XMaterial.matchXMaterial(material)
                .orElseThrow(() -> new IllegalStateException("Unknown shop material: " + material));
        return new ShopProduct(name, xMaterial, amount, price, ShopProduct.Currency.MONEY);
    }

    private ShopProduct moneyProduct(String name, String material, int amount, int price) {
        XMaterial xMaterial = XMaterial.matchXMaterial(material)
                .orElseThrow(() -> new IllegalStateException("Unknown shop material: " + material));
        return new ShopProduct(name, xMaterial, amount, price, ShopProduct.Currency.MONEY);
    }

    private ShopProduct sellProduct(String name, String material, int amount, int price) {
        XMaterial xMaterial = XMaterial.matchXMaterial(material)
                .orElseThrow(() -> new IllegalStateException("Unknown shop material: " + material));
        return new ShopProduct(name, xMaterial, amount, price, ShopProduct.Currency.MONEY, ShopProduct.Transaction.SELL);
    }

    private Economy setupEconomy() {
        if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
            getLogger().warning("Vault is not installed. Money transactions are unavailable.");
            return null;
        }
        RegisteredServiceProvider<Economy> registration = getServer().getServicesManager().getRegistration(Economy.class);
        if (registration == null || registration.getProvider() == null) {
            getLogger().warning("No Vault economy provider was found. Money transactions are unavailable.");
            return null;
        }
        return registration.getProvider();
    }
}