Saltar al contenido principal

shop_definition

Defines a shop — misc entry.

Entry Information

PropertyValue
Entry IDshop_definition
TypeMisc
ColorGreen
Iconmdi:cart

Description

Declarative definition of a shop and its items. Uses layout pool + mainLayoutId for full declarative control via GUI Extension, using shop_button: prefixed placeholders for navigation and item slots. Sub-menus (buy/sell options) are another layout in the same [layoutPool], picked by [subMenuLayoutId].

Fields

FieldTypeDescription
titleStringInventory title displayed to players. Supports color codes and placeholders.
rowsIntNumber of inventory rows (1-6). Used to determine inventory size.
fillerItemVar<Item>Item used to fill empty slots.
priceLoreList<String>Lore lines appended to each item to display prices. Placeholders: {buy}, {sell}. Supports color codes and placeholders.
currencyCurrencyTypeEconomy provider used for pricing.
balancePlaceholderStringPlaceholder used to fetch player balance when currency is placeholder.
addCommandStringCommand to add currency. {player} and {amount} will be replaced.
removeCommandStringCommand to remove currency. {player} and {amount} will be replaced.
taxRateDoubleTax percentage applied on transactions (0.0 = no tax, 10.0 = 10% tax).
taxModeTaxModeHow taxes are applied: PER_TRANSACTION (global rate) or PER_ITEM (per-item override via taxRateOverride).
resetResetPolicyPolicy determining when stock resets. Supports Cron, Interval, Daily, Weekly, and Monthly.
itemsList<ShopItemConfig>Items available in the shop.
itemPoolsList<Ref<ShopPoolEntry>>Item pools referenced by this shop. Pool items are merged into the shop display.
layoutPoolList<SimpleLayoutData>Layout pool for declarative menu design. Holds every layout this shop uses — the main menu and the buy/sell sub-menu are both selected out of this pool by id. Shop menus are simple grids: shop items are placed at SHOP_ITEM markers and buttons are shop_button: tagged slots.
mainLayoutIdStringID of the main layout within the layout pool to display.
subMenuLayoutIdStringID of the buy/sell sub-menu layout within the layout pool. Uses shop_button: prefixed placeholders. Leave empty for no sub-menu.
subMenuTitleStringTitle for the sub-menu. Supports color codes and placeholders. {item_name} placeholder available.
interactionConfigShopInteractionConfigClick-type configuration for all shop interactions. Customize which mouse buttons trigger buy/sell/submenu actions.
globalPlayerLimitIntGlobal limit per player across all items in this shop. 0 = unlimited.
globalBuyLimitIntGlobal buy limit across all items (all players combined). 0 = unlimited.
globalSellLimitIntGlobal sell limit across all items (all players combined). 0 = unlimited.
defaultRefreshTicksIntDefault refresh rate in ticks for item displays. 20 = 1 second.
perPlayerBooleanIf true, each player has their own independent shop state (stock, limits).
buySoundSound?Sound played on successful purchase.
sellSoundSound?Sound played on successful sale.
deniedSoundSound?Sound played when a transaction is denied.
infoMessageList<String>Messages shown when the information button is clicked. Supports color codes, placeholders and multiline.
buyAmountPromptStringMessage shown when entering a custom buy amount. Supports color codes and placeholders.
sellAmountPromptStringMessage shown when entering a custom sell amount. Supports color codes and placeholders.
amountConfirmButtonStringLabel used for the confirmation button in amount dialogs. Supports color codes and placeholders.
amountInputLabelStringLabel for the custom amount input. Supports color codes and placeholders.
amountInputPlaceholderStringPlaceholder text inside the custom amount input. Supports color codes and placeholders.
amountInputWidthIntWidth of the custom amount input field.
amountInputMaxLengthIntMaximum allowed length for the custom amount input.
invalidAmountMessageStringMessage shown when the entered custom amount is not a positive whole number.
cannotAffordMessageStringMessage when the player cannot afford a purchase. Placeholders: {amount}, {price}.
inventoryFullMessageStringMessage when the player's inventory is full. Placeholders: {amount}, {price}.
purchaseMessageStringMessage sent after a successful purchase. Placeholders: {amount}, {price}.
cannotSellMessageStringMessage when the item cannot be sold. Placeholders: {amount}, {price}.
notEnoughItemsMessageStringMessage when the player doesn't have enough items to sell. Placeholders: {amount}, {price}.
sellMessageStringMessage sent after a successful sale. Placeholders: {amount}, {price}.
noEconomyMessageStringMessage when no economy provider is available.
criteriaList<@Contextual Criteria>Criteria that must be met to access the shop.
criteriaFailMessageStringMessage when the required criteria are not met.
lockedItemVar<Item>Item displayed when a shop item is locked.
limitReachedMessageStringMessage when a player reaches the purchase limit for an item.
priceFormatStringPrice format template. Placeholders: {amount} = formatted price, {currency} = currency symbol. Default: {amount}
currencySymbolStringCurrency symbol used in price display. Example: $, €, pts.
artifactRef<ShopArtifact>Artifact used for persistent storage and synchronisation.

Usage Example

- entry: shop_definition
name: "Defines a shop"
title: ""
rows: 0
fillerItem: ""
priceLore: []
currency: ""
balancePlaceholder: ""
addCommand: ""
removeCommand: ""
taxRate: 0
taxMode: ""
reset: ""
items: []
itemPools: []
layoutPool: []
mainLayoutId: ""
subMenuLayoutId: ""
subMenuTitle: ""
interactionConfig: 0
globalPlayerLimit: 0
globalBuyLimit: 0
globalSellLimit: 0
defaultRefreshTicks: 0
perPlayer: false
buySound: ""
sellSound: ""
deniedSound: ""
infoMessage: []
buyAmountPrompt: ""
sellAmountPrompt: ""
amountConfirmButton: ""
amountInputLabel: ""
amountInputPlaceholder: ""
amountInputWidth: 0
amountInputMaxLength: 0
invalidAmountMessage: ""
cannotAffordMessage: ""
inventoryFullMessage: ""
purchaseMessage: ""
cannotSellMessage: ""
notEnoughItemsMessage: ""
sellMessage: ""
noEconomyMessage: ""
criteria: []
criteriaFailMessage: ""
lockedItem: ""
limitReachedMessage: ""
priceFormat: ""
currencySymbol: ""
artifact: ""