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
- Player opens the shop with
/store - Browses available categories
- Clicks a product to purchase
- If the product supports quantities (
isQuantity: true), a quantity selection screen opens - If
confirmUiis enabled inconfig.yml, a confirmation dialog appears - 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
| Placeholder | Description |
|---|---|
{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]
| Option | Type | Description |
|---|---|---|
type | Enum | GUI type: CHEST, WORKBENCH, HOPPER, DISPENSER, BREWING |
title | String | GUI title (MiniMessage format) |
rows | Integer | Number of rows (for CHEST type, 1-6) |
fillingGui | Boolean | Fill empty slots with a filler item |
fillElement | Object | Material and display name for filler items |
emptySlots | List | Slots 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
| Function | Description |
|---|---|
BUY_PRODUCT | Purchases the product assigned to this slot |
CHANGE_CATEGORY | Switches to the specified category |
DAILY_BONUS | Claims the daily bonus |
CLOSE | Closes 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>α΄α΄Ι΄κ°ΙͺΚα΄"
| Option | Type | Description |
|---|---|---|
productSlot | Integer | Slot where the product item is displayed |
Confirmation Functions
| Function | Description |
|---|---|
CONFIRM | Completes the purchase |
CANCEL | Returns 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
| Option | Type | Description |
|---|---|---|
productSlot | Integer | Slot showing the product preview |
quantityDisplaySlot | Integer | Slot showing current quantity |
totalPriceSlot | Integer | Slot showing total price |
maxQuantity | Integer | Maximum purchasable quantity |
Display Items
quantityDisplayItem:
material: PAPER
displayName: "<#FCD05C>Qα΄α΄Ι΄α΄Ιͺα΄Κ: <#FFFFFF>{quantity}"
totalPriceItem:
material: EMERALD
displayName: "<#19B700>α΄α΄α΄α΄Κ: <#3CF11F>{totalPrice}$"
| Placeholder | Description |
|---|---|
{quantity} | Currently selected quantity |
{totalPrice} | Total price based on quantity |
Quantity Functions
| Function | Description |
|---|---|
QUANTITY_INCREASE | Increases quantity by the elementβs amount value |
QUANTITY_DECREASE | Decreases quantity by the elementβs amount value |
CONFIRM | Proceeds to purchase confirmation |
CANCEL | Returns to the shop |