Configuration Files
JoyMart ships three top-level config files plus per-game config files. All of them live under plugins/JoyMart/ and are auto-generated on first startup.
config.yml — Global Config
Key nodes (mirrored by plugins/JoyMart/config.yml):
# ---------------- Economy ----------------
economy:
tokens: true # Enable JoyMart tokens (internal currency, stored per player)
vault: true # Hook into Vault (coin rewards/costs, optional)
# ---------------- Storage ----------------
storage:
type: yaml # yaml = local files, mysql = database (HikariCP pool)
autoSaveInterval: 120 # Auto-save interval (seconds); 0 = disabled (save only on quit)
mysql: # Only when storage.type=mysql
host: localhost
port: 3306
database: gamebox
user: root
password: ''
poolSize: 10 # HikariCP pool size
bungee: false # true = share high-score table across BungeeCord sub-servers
# ---------------- Language ----------------
language:
default: en # en / zh / de / es (falls back to en if missing)
# ---------------- Lobby ----------------
lobby:
enabled: false # Lobby mode
worlds: [world] # Worlds that receive the hotbar shortcut item
slot: 4 # Hotbar slot for the shortcut item (0-8)
material: NETHER_STAR
name: '&6&lJoyMart'
lockItem: true # Prevent players from dropping/moving the shortcut item
# ---------------- Invitations ----------------
invitations:
expiry: 30 # Invitation expiry (seconds)
style: json # json (chat-clickable) / actionbar / title
# ---------------- Navigation ----------------
navigation:
mainMenuSize: 45 # Main menu size (multiple of 9, max 54)
backButtonSlot: 40 # Back-button slot in game GUIs (-1 = none)
closeButtonSlot: 44 # Close-button slot (-1 = none)
# ---------------- Sounds ----------------
sounds:
enabled: true
click: UI_BUTTON_CLICK
win: ENTITY_PLAYER_LEVELUP
lose: BLOCK_ANVIL_LAND
token: ENTITY_EXPERIENCE_ORB_PICKUP
# ---------------- Scoreboard ----------------
scoreboard:
enabled: true # Sidebar scoreboard during a game (game/score/highscore/tokens)
# ---------------- Custom commands ----------------
commands:
onEnter: [] # Run as console when a player enters JoyMart
onLeave: [] # Run as console when a player leaves JoyMart
# ---------------- Shop ----------------
shop:
enabled: true # Master switch for the token shop
# ---------------- bStats ----------------
bstats: trueStorage & economy
The storage block is covered in depth in Data Storage. The economy block controls the token system and the optional Vault hook.
games.yml — Per-Game Config
games:
2048:
enabled: true
subCommands: [2048, twentyfortyeight]
minesweeper:
enabled: true
subCommands: [ms, minesweeper]
# ... same pattern for other gamesDetailed per-game parameters (scores, rewards, costs, combo thresholds, etc.) live in plugins/JoyMart/games/<id>/config.yml, auto-copied from the jar on first startup.
TIP
See Game Modes for what each game does, and Scoring & Events for how scores and rewards are calculated.
Lottery / Slot Machine Prize Pool Config
Lottery (lottery) and Slot Machine (slotmachine) share the same prize-pool format. You can edit it in-game via GUI (recommended) or directly edit plugins/JoyMart/games/<id>/config.yml:
# Token cost per draw / spin (0 = free)
cost: 20
# Prize pool: weighted-random pick of one prize
prizes:
- weight: 50 # Weight (>= 0; larger = more likely)
tokens: 10 # Token reward (optional)
money: 0.0 # Coin reward (requires Vault, optional)
commands: [] # Console commands (%player% replaced with player name, optional)
displayName: '&eSmall prize +10 tokens'
- weight: 5
tokens: 200
money: 100.0
commands:
- 'say %player% hit the jackpot!'
displayName: '&6&lJackpot +200 tokens + 100 coins'
- weight: 45
tokens: 0
displayName: '&7No prize'TIP
When edited via the GUI, all changes are written back to this file immediately — no manual editing needed.
tokenShop.yml — Token Shop
Supports categories + items. Per-item fields:
items:
my_item:
material: DIAMOND
name: '&bDiamond'
lore:
- '&7Cost: &e50 tokens'
cost: 50
permission: '' # Permission to see the item (empty = everyone)
buyPermission: '' # Permission to buy (empty = everyone)
commands: # Run as console on purchase
- 'give %player% diamond 1'
closeAfter: true # Close GUI after purchase (default true)
confirm: false # Require a second click to confirm (default false)%player% is replaced with the buyer's name.
Shop Management GUI (categories / list / unlist)
You don't need to hand-edit tokenShop.yml — admins with permission can manage it via the in-game GUI:
Two entry points:
/gba shop(requiresgamebox.admin.shop)- Open the
/gbmain menu → enter the token shop → bottom-right "Manage Shop" button (visible only to permissioned players)
Operations:
- Add category: On the shop-management main page, click the "+ Add Category" button at the bottom-left → type the category key in chat (lowercase letters/digits/underscores) → type the display name → the category is created and saved to
tokenShop.yml. - Rename category: Enter a category's management page → click the "Rename Category" button at the bottom → type the new name in chat → auto-saved.
- Delete category: Enter a category's management page → click "Delete Category" at the bottom → click again to confirm → the category and all its items are removed and saved.
- List item: Enter a category's management page → hold the item on your cursor → click the "+ List Item" slot at the bottom. The item is added to the category at the default price of 10 tokens and saved to
tokenShop.yml. - Unlist: Click any item in the category-management page → first click asks for confirmation → second click removes it and saves.
- Reprice / Rename: Click an item in the category-management page to enter its edit page → use +/- buttons to adjust the price, or click the rename button and type the new name in chat.
- The item name/lore listed will follow the cursor item's display name and lore; the default price is 10, but you can change it on the edit page.
Listing / Unlisting fix note
Older versions modified the cursor item synchronously inside the event callback, causing a desync issue where the item would "disappear from the cursor but not actually be listed/unlisted". This version wraps all cursor modifications and build() calls inside Bukkit.getScheduler().runTask(), deferring them to the next tick to eliminate client/server state mismatch. All management-UI texts are fully localized (using the gui.shop* keys from language_<lang>.yml).
Shop permission
The gamebox.admin.shop permission defaults to OP only and is a child of gamebox.admin.*. Non-privileged players cannot see the management button or run /gba shop.