Per-Game Configuration
Each game's runtime parameters (icon, cost, GUI size, score scaling, rewards, game-specific settings, etc.) live in a dedicated plugins/JoyMart/games/<id>/config.yml file. On first server startup the plugin auto-copies the default config from inside the jar; afterwards admins can edit it by hand or through the in-game GUI (recommended). Either way, run /gba reload to hot-reload — no restart needed.
This page documents the game-specific options and a full example for each of the 15 games. For how each game plays see Game Modes; for how scores and rewards are calculated see Scoring & Events.
Auto-copy mechanism
The plugin creates a sub-directory named after each game id under plugins/JoyMart/games/ (e.g. 2048/, minesweeper/, monopoly/). If a config.yml is missing, the plugin copies the matching default file out of the jar; deleting the file regenerates the default on next startup. To toggle games or change their sub-commands see Configuration Files.
Common Fields
The fields below form the shared base structure of every game's config.yml. Not every field appears in every file — some games omit inapplicable ones (for example, versus games usually have no scorePerToken / trackHighScore); omitted fields fall back to their defaults.
| Field | Type | Description |
|---|---|---|
icon.material | Material | Item shown in the game selection GUI (Spigot 1.21 material name, e.g. PAPER) |
cost | Decimal | Economy cost to start a game (0.0 = free) |
guiSize | Integer | Size of the game inventory (must be a multiple of 9, range 9–54) |
scorePerToken | Integer | Bonus tokens = score ÷ scorePerToken (0 = no score-based token scaling) |
moneyPerToken | Decimal | Bonus money = bonus tokens × moneyPerToken (0.0 = no money scaling, requires Vault) |
trackHighScore | Boolean | Whether scores are saved to the high-score table |
rewards.win.tokens | Integer | Tokens awarded on a win |
rewards.win.money | Decimal | Money awarded on a win (requires Vault) |
rewards.win.commands | List | Console commands run on a win (%player% replaced with the player name) |
rewards.lose.tokens | Integer | Tokens awarded on a loss |
rewards.lose.money | Decimal | Money awarded on a loss (requires Vault) |
Single-player vs. versus reward structure
- Single-player / Lottery / Slot Machine: use the
rewards.winandrewards.losebranches. - Versus games (Chess, Battleship, Connect 4, Tic-Tac-Toe, Rock-Paper-Scissors, Monopoly): use the
rewards.winner/rewards.loser/rewards.drawbranches;winnerandlosermay each carry their owncommands.
Lottery and Slot Machine pay out from their own prizes pool, so their rewards block is just a placeholder (usually 0). See Scoring & Events for the full reward logic.
Material names target 1.21
icon.material must use Spigot 1.21 material enum names (e.g. BROWN_CONCRETE, END_PORTAL_FRAME). Some names differ on older servers — update them after upgrading.
2048
The classic number-merging game: slide tiles on a 4×4 grid to combine equal numbers, aiming to build the 2048 tile. Merge score is converted to bonus tokens via scorePerToken.
| Game-specific setting | Default | Description |
|---|---|---|
settings.gridSize | 4 | Grid edge length (4 = 4×4) |
settings.targetTile | 2048 | Tile value required to win |
icon:
material: PAPER
cost: 0.0
guiSize: 45
scorePerToken: 100
moneyPerToken: 0.0
trackHighScore: true
settings:
gridSize: 4
targetTile: 2048
rewards:
win:
tokens: 10
money: 5.0
commands: []
lose:
tokens: 1
money: 0.0Minesweeper
Classic Minesweeper. guiSize must equal rows × cols and not exceed 54; cols is capped at 9 to fit the chest width. The default board is 6×9 = 54 cells with 10 mines.
| Game-specific setting | Default | Description |
|---|---|---|
settings.rows | 6 | Number of rows (constrained by guiSize) |
settings.cols | 9 | Number of columns (max 9) |
settings.mines | 10 | Number of mines |
icon:
material: TNT
cost: 0.0
guiSize: 54
scorePerToken: 100000
moneyPerToken: 0.0
trackHighScore: true
settings:
rows: 6
cols: 9
mines: 10
rewards:
win:
tokens: 15
money: 10.0
commands: []
lose:
tokens: 1
money: 0.0Grid and inventory size are linked
After changing rows / cols, set guiSize to rows × cols (and keep it a multiple of 9) or the cells won't fill the inventory.
Whack-a-Mole
Timed mole-whacking. durationSeconds sets the round length and popIntervalTicks the mole pop cadence (20 ticks = 1 second). Hit score is converted to tokens via scorePerToken.
| Game-specific setting | Default | Description |
|---|---|---|
settings.durationSeconds | 30 | Round length (seconds) |
settings.popIntervalTicks | 20 | Ticks between mole pop-ups (20 = 1 second) |
icon:
material: BROWN_CONCRETE
cost: 0.0
guiSize: 27
scorePerToken: 2
rewards:
win:
tokens: 5
money: 0.0
commands: []
lose:
tokens: 0
money: 0.0
settings:
durationSeconds: 30
popIntervalTicks: 20Bejeweled
A match-3 game. Swap adjacent gems on a rows × cols grid; lining up 3 or more clears them. moveLimit caps the number of swaps before the game settles. Rows max 6, columns max 8.
| Game-specific setting | Default | Description |
|---|---|---|
settings.rows | 6 | Number of rows (max 6) |
settings.cols | 8 | Number of columns (max 8) |
settings.moveLimit | 20 | Number of swaps allowed |
icon:
material: PURPLE_CONCRETE
cost: 0.0
guiSize: 54
scorePerToken: 5
rewards:
win:
tokens: 5
money: 0.0
commands: []
lose:
tokens: 0
money: 0.0
settings:
rows: 6
cols: 8
moveLimit: 20Lottery
A numeric lottery: players pick pickCount numbers from a pool of poolSize, then the game draws pickCount winning numbers. The match count selects the prize tier (prizes[matches]).
Tokens only
The lottery only awards tokens — no items or money. Even if you fill in money / commands on a prize, they have no effect.
| Game-specific setting | Default | Description |
|---|---|---|
settings.poolSize | 16 | Size of the number pool |
settings.pickCount | 4 | Numbers picked by the player / drawn by the game |
Prize tier format
prizes is a list indexed by match count (subscript 0..pickCount); weight is unused for the lottery (tiers are selected by matches, not weighted random). material / name are only used to display the tier in the "Edit Prizes" GUI.
| Matches | Material | Name | Tokens |
|---|---|---|---|
| 0 | COAL | &8安慰奖 (0 中) | 0 |
| 1 | IRON_INGOT | &f小奖 (1 中) | 1 |
| 2 | GOLD_INGOT | &e中奖 (2 中) | 5 |
| 3 | DIAMOND | &b大奖 (3 中) | 20 |
| 4 | NETHER_STAR | &6头奖 (4 中全中!) | 100 |
icon:
material: SUNFLOWER
cost: 0.0
guiSize: 45
scorePerToken: 0
moneyPerToken: 0.0
trackHighScore: true
settings:
poolSize: 16
pickCount: 4
rewards:
win:
tokens: 0
money: 0.0
commands: []
lose:
tokens: 0
money: 0.0
# Prize tiers indexed by match count (0..pickCount).
# weight is unused here; tiers are picked by matches, not random.
# Only tokens are awarded — no money or item commands.
prizes:
- material: COAL
name: '&8安慰奖 (0 中)'
weight: 0
tokens: 0
money: 0.0
commands: []
- material: IRON_INGOT
name: '&f小奖 (1 中)'
weight: 0
tokens: 1
money: 0.0
commands: []
- material: GOLD_INGOT
name: '&e中奖 (2 中)'
weight: 0
tokens: 5
money: 0.0
commands: []
- material: DIAMOND
name: '&b大奖 (3 中)'
weight: 0
tokens: 20
money: 0.0
commands: []
- material: NETHER_STAR
name: '&6头奖 (4 中全中!)'
weight: 0
tokens: 100
money: 0.0
commands: []Editing via GUI is easier
Lottery prize tiers can be added, removed, and tweaked in-game via the "Edit Prizes" button (requires gamebox.admin.games); changes are written back to this file. The shared prize-pool field reference is in Configuration Files.
Default prize names are in Chinese
The shipped default name strings are in Chinese (e.g. &6头奖 (4 中全中!)) with & color codes. They are pure display labels — feel free to translate or rewrite them; only tokens affects the actual payout.
Slot Machine
A classic slot machine: each spin costs spinCostTokens tokens and the three reels stop on random symbols. The outcome is a weighted-random pick from the prizes list (higher weight = more likely). material is also used as the symbol shown on the center reel.
Prize pool format
Each prizes entry can award tokens, money (requires Vault), and console commands (%player% replaced with the player name) at once. This format is shared with the Lottery — see Configuration Files.
| Material | Name | Weight | Tokens | Money | Commands |
|---|---|---|---|---|---|
COAL | &8没中奖 | 60 | 0 | 0.0 | — |
IRON_INGOT | &f小奖 | 25 | 3 | 0.0 | give %player% iron_ingot 1 |
GOLD_INGOT | &e中奖 | 12 | 8 | 0.0 | give %player% gold_ingot 1 |
DIAMOND | &b大奖 | 2 | 30 | 0.0 | give %player% diamond 1 |
NETHER_STAR | &6超级大奖! | 1 | 150 | 100.0 | give %player% nether_star 1 |
| Game-specific setting | Default | Description |
|---|---|---|
settings.spinCostTokens | 2 | Token cost per spin |
icon:
material: DISPENSER
cost: 0.0
guiSize: 27
scorePerToken: 0
moneyPerToken: 0.0
trackHighScore: true
settings:
spinCostTokens: 2
rewards:
win:
tokens: 0
money: 0.0
commands: []
lose:
tokens: 0
money: 0.0
# Weighted prize pool: higher weight = more likely; tokens/money/commands
# are all awarded when a prize is hit. material is also the center-reel symbol.
prizes:
- material: COAL
name: '&8没中奖'
weight: 60
tokens: 0
money: 0.0
commands: []
- material: IRON_INGOT
name: '&f小奖'
weight: 25
tokens: 3
money: 0.0
commands:
- 'give %player% iron_ingot 1'
- material: GOLD_INGOT
name: '&e中奖'
weight: 12
tokens: 8
money: 0.0
commands:
- 'give %player% gold_ingot 1'
- material: DIAMOND
name: '&b大奖'
weight: 2
tokens: 30
money: 0.0
commands:
- 'give %player% diamond 1'
- material: NETHER_STAR
name: '&6超级大奖!'
weight: 1
tokens: 150
money: 100.0
commands:
- 'give %player% nether_star 1'Maze
Navigate from the top-left to the bottom-right goal in as few moves as possible. Score is max(0, 1000 - moves × 10). gridSize is capped at 6 (it must fit a 6-row inventory).
| Game-specific setting | Default | Description |
|---|---|---|
settings.gridSize | 6 | Maze edge length (max 6) |
icon:
material: END_PORTAL_FRAME
cost: 0.0
guiSize: 54
scorePerToken: 0
moneyPerToken: 0.0
trackHighScore: true
settings:
gridSize: 6
rewards:
win:
tokens: 5
money: 0.0
commands: []
lose:
tokens: 0
money: 0.0Snake
Steer a snake around the grid eating food; the snake speeds up as it grows. startIntervalTicks is the initial move interval; each food eaten shaves off speedupTicks ticks, down to a floor of minIntervalTicks.
| Game-specific setting | Default | Description |
|---|---|---|
settings.startIntervalTicks | 20 | Initial move interval (ticks, 20 = 1 second) |
settings.minIntervalTicks | 6 | Minimum move interval after speed-up (lower = faster) |
settings.speedupTicks | 1 | Ticks removed per food eaten |
icon:
material: LIME_WOOL
cost: 0.0
guiSize: 54
scorePerToken: 50
moneyPerToken: 0.0
trackHighScore: true
settings:
startIntervalTicks: 20
minIntervalTicks: 6
speedupTicks: 1
rewards:
win:
tokens: 10
money: 5.0
commands: []
lose:
tokens: 1
money: 0.0Dino Run
A side-scrolling runner: the dino runs in place while cacti scroll in from the right — click jump to clear them. scrollIntervalTicks controls world scroll speed; minObstacleGap / maxObstacleGap bound the spacing between consecutive cacti (the gap shrinks as your score rises, ramping up difficulty).
| Game-specific setting | Default | Description |
|---|---|---|
settings.scrollIntervalTicks | 6 | World scroll interval (ticks, lower = faster) |
settings.minObstacleGap | 4 | Minimum gap between cacti (scroll steps) |
settings.maxObstacleGap | 9 | Maximum gap between cacti (scroll steps) |
icon:
material: LIME_WOOL
cost: 0.0
guiSize: 54
scorePerToken: 30
moneyPerToken: 0.0
trackHighScore: true
settings:
scrollIntervalTicks: 6
minObstacleGap: 4
maxObstacleGap: 9
rewards:
win:
tokens: 10
money: 5.0
commands: []
lose:
tokens: 1
money: 0.0Chess
A 6×6 Los Alamos chess variant (no bishops), playable against another player or a simple AI. Pieces per side: 1 King, 1 Queen, 2 Rooks, 2 Knights, 6 Pawns. The 6×6 board is used because a Bukkit inventory caps at 54 slots — Los Alamos is the closest playable international-chess-like variant that fits. Win/lose/draw use rewards.winner / rewards.loser / rewards.draw.
icon:
material: GOLD_BLOCK
cost: 0.0
guiSize: 54
scorePerToken: 0
moneyPerToken: 0.0
trackHighScore: true
rewards:
winner:
tokens: 15
money: 10.0
commands: []
loser:
tokens: 1
money: 0.0
commands: []
draw:
tokens: 2
money: 0.0Gameplay & AI
Piece movement, check / checkmate / stalemate detection, and the two-ply minimax AI are described in Game Modes — Chess.
Battleship
A two-player game (or vs. AI). gridSize is the number of ocean-grid columns (max 7, to keep two info columns) and gridRows the rows (max 6, to fit a size-54 inventory).
| Game-specific setting | Default | Description |
|---|---|---|
settings.gridSize | 7 | Ocean-grid columns (max 7) |
settings.gridRows | 6 | Ocean-grid rows (max 6) |
icon:
material: IRON_BLOCK
cost: 0.0
rewards:
winner:
tokens: 5
money: 10.0
commands:
- "say %player% won a game of Battleship!"
loser:
tokens: 1
money: 0.0
commands: []
draw:
tokens: 2
money: 0.0
settings:
gridSize: 7
gridRows: 6About cost
Battleship starts via the two-player invite flow and does not charge cost; the value is only consulted for single-player affordability checks (there is no single-player flow here). It defaults to 0.0.
Connect 4
A two-player game (or vs. AI). cols is the number of columns (max 7) and rows the rows (max 6, to fit a size-54 inventory).
| Game-specific setting | Default | Description |
|---|---|---|
settings.cols | 7 | Board columns (max 7) |
settings.rows | 6 | Board rows (max 6) |
icon:
material: YELLOW_CONCRETE
cost: 0.0
rewards:
winner:
tokens: 5
money: 10.0
commands:
- "say %player% won a game of Connect 4!"
loser:
tokens: 1
money: 0.0
commands: []
draw:
tokens: 2
money: 0.0
settings:
cols: 7
rows: 6Tic-Tac-Toe
bestOf sets how many games make up a match (1 = single deciding game).
| Game-specific setting | Default | Description |
|---|---|---|
settings.bestOf | 1 | Number of games per match |
icon:
material: RED_CONCRETE
cost: 0.0
rewards:
winner:
tokens: 5
money: 0.0
commands: []
loser:
tokens: 1
money: 0.0
commands: []
draw:
tokens: 2
money: 0.0
settings:
bestOf: 1Rock-Paper-Scissors
bestOf sets the match length; the first player to win ceil(bestOf / 2) rounds takes the match. The default bestOf: 3 means first to 2 round wins.
| Game-specific setting | Default | Description |
|---|---|---|
settings.bestOf | 3 | Match length; first to ceil(bestOf/2) round wins takes it |
icon:
material: SHEARS
cost: 0.0
rewards:
winner:
tokens: 5
money: 0.0
commands: []
loser:
tokens: 1
money: 0.0
commands: []
draw:
tokens: 2
money: 0.0
settings:
bestOf: 3Monopoly
A GUI recreation of classic Monopoly, supporting 2–3 players or 1 human + AI. startMoney is each player's starting cash, passGoBonus the bonus collected when passing GO, and jailFee the fee to leave jail. 17 properties are laid out around a 26-space board; prices and rents can be edited here or via the in-game settings editor GUI.
| Game-specific setting | Default | Description |
|---|---|---|
settings.startMoney | 2000 | Starting cash per player |
settings.passGoBonus | 200 | Bonus collected when passing GO |
settings.jailFee | 50 | Fee paid to leave jail |
Property list
The 17 default buyable properties. The & in each name is a Minecraft color code, kept exactly as in the source file.
| # | Name | Price | Rent |
|---|---|---|---|
| 1 | &6老街 | 60 | 4 |
| 2 | &6市政厅 | 80 | 6 |
| 3 | &a公园大道 | 100 | 8 |
| 4 | &a商业街 | 120 | 10 |
| 5 | &e火车站 | 200 | 25 |
| 6 | &a购物中心 | 160 | 14 |
| 7 | &b金融街 | 180 | 16 |
| 8 | &b科技园 | 200 | 18 |
| 9 | &e机场 | 200 | 25 |
| 10 | &b大学城 | 240 | 20 |
| 11 | &c艺术区 | 260 | 22 |
| 12 | &c夜市 | 280 | 24 |
| 13 | &c海滩 | 300 | 26 |
| 14 | &d别墅区 | 320 | 28 |
| 15 | &d摩天大楼 | 400 | 50 |
| 16 | &d港口 | 350 | 35 |
| 17 | &6金矿 | 380 | 38 |
Board layout
A 26-space looped board (clockwise, numbered 0–25 from GO):
| Space | Type |
|---|---|
| 0 | GO |
| 8 | Jail |
| 13 | FreeParking |
| 19 | GoToJail |
| 4 / 15 / 21 | Chance |
| 2 / 11 | CommunityChest |
| 1, 3, 5, 6, 7, 9, 10, 12, 14, 16, 17, 18, 20, 22, 23, 24, 25 | 17 properties (in the table order above) |
Full config
icon:
material: GOLD_BLOCK
cost: 0.0
settings:
startMoney: 2000
passGoBonus: 200
jailFee: 50
rewards:
winner:
tokens: 10
money: 0.0
commands: []
loser:
tokens: 2
money: 0.0
commands: []
draw:
tokens: 3
money: 0.0
# 17 properties laid out around the 26-space board (clockwise from GO):
# 0=GO, 8=Jail, 13=FreeParking, 19=GoToJail (corners)
# 4,15,21=Chance 2,11=CommunityChest
# Properties occupy the remaining 17 positions:
# 1,3,5,6,7,9,10,12,14,16,17,18,20,22,23,24,25
properties:
- name: '&6老街'
price: 60
rent: 4
- name: '&6市政厅'
price: 80
rent: 6
- name: '&a公园大道'
price: 100
rent: 8
- name: '&a商业街'
price: 120
rent: 10
- name: '&e火车站'
price: 200
rent: 25
- name: '&a购物中心'
price: 160
rent: 14
- name: '&b金融街'
price: 180
rent: 16
- name: '&b科技园'
price: 200
rent: 18
- name: '&e机场'
price: 200
rent: 25
- name: '&b大学城'
price: 240
rent: 20
- name: '&c艺术区'
price: 260
rent: 22
- name: '&c夜市'
price: 280
rent: 24
- name: '&c海滩'
price: 300
rent: 26
- name: '&d别墅区'
price: 320
rent: 28
- name: '&d摩天大楼'
price: 400
rent: 50
- name: '&d港口'
price: 350
rent: 35
- name: '&6金矿'
price: 380
rent: 38Gameplay & betting
The full 2–3 player flow, the 3-player-only betting mechanic, and the AI opponent behavior are described in Game Modes — Monopoly.