Shop System

How to configure products, categories, and the shop GUI.

Overview

mineWallet includes a fully configurable in-game shop accessible via the /store command. Players can browse product categories, select quantities, and confirm purchases β€” all through inventory-based GUIs.

Purchase Flow

  1. Player opens the shop with /store
  2. Browses available categories
  3. Clicks a product to purchase
  4. If the product supports quantities (isQuantity: true), a quantity selection screen opens
  5. If confirmUi is enabled in config.yml, a confirmation dialog appears
  6. On confirmation, the purchase is executed:
    • Balance is deducted from the wallet
    • Product commands are executed
    • Wallet is saved and synced across servers
    • A notification is broadcast (if enabled)

Tip: If a player does not have enough money, a barrier item appears briefly in place of the product.

Defining Products

Products are configured in the products section of config.yml:

products:
  defaultCategory: "ranks"
  availableProducts:
    - name: "vip"
      price: 10.0
      category: "ranks"
      isQuantity: false
      possibleDiscount: true
      commands:
        - "lp user {player} parent set vip"
      purchaseDisplay: "<#FFD700>VIP"

    - name: "diamonds"
      price: 2.5
      category: "items"
      isQuantity: true
      possibleDiscount: false
      commands:
        - "give {player} minecraft:diamond {quantity}"
      purchaseDisplay: "<#00BFFF>Diamonds"

Command Placeholders

PlaceholderDescription
{player}Name of the purchasing player
{quantity}Number of items purchased (for quantity products)

Shop GUI (store-ui.yml)

The shop layout is fully configurable through store-ui.yml.

General Settings

type: CHEST
title: "<#FF7C31>Ρ•Κœα΄α΄˜"
rows: 5
fillingGui: true
fillElement:
  material: BLACK_STAINED_GLASS_PANE
  displayName: " "
emptySlots: [19, 20, 21, 22, 23, 24, 25]
OptionTypeDescription
typeEnumGUI type: CHEST, WORKBENCH, HOPPER, DISPENSER, BREWING
titleStringGUI title (MiniMessage format)
rowsIntegerNumber of rows (for CHEST type, 1-6)
fillingGuiBooleanFill empty slots with a filler item
fillElementObjectMaterial and display name for filler items
emptySlotsListSlots reserved for products

Not Enough Money Indicator

noEnoughMoneyItemShow: true
noEnoughMoneyItem:
  material: BARRIER
  displayName: "<#FF0000>✘ Not enough money"
  amount: 1

When enabled, a barrier item briefly replaces the product if the player cannot afford it.

GUI Elements

Each element in the elements list defines a clickable item in the shop:

elements:
  - slot: 2
    material: GOLDEN_APPLE
    function: CHANGE_CATEGORY
    category: "ranks"
    displayName: "<#FCD05C>Κ€α΄€Ι΄α΄‹Ρ•"
    amount: 1
    lore: []

Element Functions

FunctionDescription
BUY_PRODUCTPurchases the product assigned to this slot
CHANGE_CATEGORYSwitches to the specified category
DAILY_BONUSClaims the daily bonus
CLOSECloses the shop GUI

Confirmation GUI (pay-confirm-ui.yml)

The purchase confirmation dialog layout:

type: CHEST
title: "<#FF7C31>α΄„α΄Ι΄κœ°Ιͺʀᴍ"
rows: 3
productSlot: 13
elements:
  - slot: 10
    material: RED_CONCRETE
    function: CANCEL
    displayName: "<#FF3535>α΄„α΄€Ι΄α΄„α΄‡ΚŸ"
  - slot: 16
    material: LIME_CONCRETE
    function: CONFIRM
    displayName: "<#35FF3A>α΄„α΄Ι΄κœ°Ιͺʀᴍ"
OptionTypeDescription
productSlotIntegerSlot where the product item is displayed

Confirmation Functions

FunctionDescription
CONFIRMCompletes the purchase
CANCELReturns to the shop

Quantity Selection GUI (quantity-select-ui.yml)

For products with isQuantity: true, this GUI allows players to choose how many to buy:

type: CHEST
title: "<#FF7C31>κœ±α΄‡ΚŸα΄‡α΄„α΄› Qα΄œα΄€Ι΄α΄›Ιͺᴛʏ"
rows: 4
productSlot: 4
quantityDisplaySlot: 13
totalPriceSlot: 22
maxQuantity: 64
OptionTypeDescription
productSlotIntegerSlot showing the product preview
quantityDisplaySlotIntegerSlot showing current quantity
totalPriceSlotIntegerSlot showing total price
maxQuantityIntegerMaximum purchasable quantity

Display Items

quantityDisplayItem:
  material: PAPER
  displayName: "<#FCD05C>Qα΄œα΄€Ι΄α΄›Ιͺᴛʏ: <#FFFFFF>{quantity}"

totalPriceItem:
  material: EMERALD
  displayName: "<#19B700>α΄›α΄α΄›α΄€ΚŸ: <#3CF11F>{totalPrice}$"
PlaceholderDescription
{quantity}Currently selected quantity
{totalPrice}Total price based on quantity

Quantity Functions

FunctionDescription
QUANTITY_INCREASEIncreases quantity by the element’s amount value
QUANTITY_DECREASEDecreases quantity by the element’s amount value
CONFIRMProceeds to purchase confirmation
CANCELReturns to the shop