config.yml
Global settings - timing, storage, number format, currency, wand, shards, boosters, commands, teleport, auto-AFK, shop switches and sounds.
Global settings. After editing, run /afkzoneadmin reload (the Commands and Settings.Storage
sections need a restart).
config.yml is read without bundled defaults, so a key you delete stays deleted. A missing
Settings, Settings.Number-Format, Settings.Storage, Currency, Wand, Shards,
Shards.Boosters, Teleport, Auto-AFK, Auto-AFK.Regions, Commands or Shop section is a loud
error, not a silent default.
Settings
Section titled “Settings”Settings: Check-Interval: 20 Save-Interval: 300 Storage: Type: SQLITE Host: "127.0.0.1" Port: 3306 Database: "minecraft" Username: "root" Password: "" Number-Format: Default: SEPARATED Separated: Grouping-Separator: "," Decimal-Separator: "." Decimals: 2 Abbreviated: Thousands: "K" Millions: "M" Billions: "B" Trillions: "T" # ... every scale up to Centillions| Key | Default | Description |
|---|---|---|
Check-Interval |
20 |
Ticks between each player’s zone check (minimum 1). Also the refresh rate of the action bar and boss bar, so keep it at 20 or the action bar fades between updates. Progress is tracked in ticks, so payouts stay exact at any value. The auto-AFK idle check runs on the same tick. |
Save-Interval |
300 |
Seconds between saves of player data to the database. 0 turns the timer off (data is then saved on quit and shutdown only). |
Storage |
see below | Where player data is kept. |
Number-Format |
see below | How shard amounts are printed everywhere ({shards}, prices, placeholders). |
Storage
Section titled “Storage”| Key | Default | Description |
|---|---|---|
Type |
SQLITE |
SQLITE (a local file at data/data.db) or MYSQL. |
Host |
127.0.0.1 |
MySQL host. |
Port |
3306 |
MySQL port. |
Database |
minecraft |
MySQL database (schema) name. |
Username |
root |
MySQL user. |
Password |
"" |
MySQL password. |
Properties |
none | Optional section of extra MySQL connection properties, for example useSSL: "false". |
Host through Properties are ignored with SQLite. The tables (afkzone_players,
afkzone_boosters) are created automatically. Changing storage needs a full restart, and existing
data is not copied between SQLite and MySQL.
Number-Format
Section titled “Number-Format”| Key | Default | Description |
|---|---|---|
Default |
SEPARATED |
SEPARATED prints 12,500. ABBREVIATED prints 12.5K. |
Separated.Grouping-Separator |
, |
Thousands separator. Exactly one character. |
Separated.Decimal-Separator |
. |
Decimal point used in abbreviated values. Exactly one character. |
Separated.Decimals |
2 |
Maximum decimals in an abbreviated value (0 to 8), rounded down. Shards are whole numbers, so separated values never show decimals. |
Abbreviated.<Scale> |
K, M, B, T, Qa, … |
The suffix for each scale, from Thousands up to Centillions. The list must start at Thousands and be contiguous; you can stop early. |
Currency
Section titled “Currency”How shards look in every message, menu and placeholder.
Currency: Display-Name: "Shards" Symbol: "" Primary-Color: "&d" Secondary-Color: "&5" Decimals: false| Key | Default | Description |
|---|---|---|
Display-Name |
Shards |
The currency name, shown as {currency}. Used for every amount, singular and plural. |
Symbol |
"" |
Put in front of every amount (✦1,250). |
Primary-Color |
&d |
Color of amounts ({shards}, {price}). |
Secondary-Color |
&5 |
Color of the currency name ({currency}). |
Decimals |
false |
Leave at false: shards are whole numbers. |
%optimalafkzone_shards% prints the amount with the symbol but without colors.
Wand: Outline: Enabled: true Interval: 10 Spacing: 0.5 Max-Points: 600 Range: 64.0 Selection-Particle: "HAPPY_VILLAGER" Zone-Particle: "END_ROD" Item: Material: BLAZE_ROD Name: "&d&lAFK Wand" Glow: true Lore: - "&8AFK Zone" - "" - "&dUsage:" - "&5 - &7Left-Click: &fPosition 1" - "&5 - &7Right-Click: &fPosition 2" - "" - "&e➥ Run /afkzoneadmin create <zone>!"Outline controls the particle outline drawn around a wand selection and around zones toggled with
/afkzoneadmin outline. Every key except the two particles is required.
| Key | Default | Description |
|---|---|---|
Outline.Enabled |
true |
Draw the outlines at all. |
Outline.Interval |
10 |
Ticks between redraws. At least 1. |
Outline.Spacing |
0.5 |
Blocks between particles along an edge (smaller is denser). Above 0. |
Outline.Max-Points |
600 |
Cap on particles per outline. At least 1. |
Outline.Range |
64.0 |
Only draw for players within this many blocks. Above 0. |
Outline.Selection-Particle |
HAPPY_VILLAGER |
Particle for your wand selection. |
Outline.Zone-Particle |
END_ROD |
Particle for /afkzoneadmin outline. |
Item |
- | The wand item: Material, Name, Lore, Glow and the other standard item fields. |
Particle names are resolved through XSeries, so legacy names such as VILLAGER_HAPPY work. Particles
that need extra data (such as DUST) are refused when the config loads.
Shards
Section titled “Shards”Shards: Enabled: true Boosters: Enabled: true Permission-Boosters: true Permission-Prefix: "optimalafkzone.booster."| Key | Default | Description |
|---|---|---|
Enabled |
true |
Master switch. When false, zones pay no shards and always run their own Rewards whatever their Reward-Mode, and /afkzone shards and /afkzoneadmin shards reply SHARDS-DISABLED. |
Boosters.Enabled |
true |
Master switch for boosters. When false, every multiplier is 1 and right-clicking a booster item does nothing. |
Boosters.Permission-Boosters |
true |
Read permanent multipliers from permissions. |
Boosters.Permission-Prefix |
optimalafkzone.booster. |
The prefix of a permission booster. The rest of the node is the multiplier, for example optimalafkzone.booster.2 or optimalafkzone.booster.1.5. |
A permission booster must be granted explicitly. Its multiplier is a number with up to four digits and up to four decimals; the highest one a player holds is used.
Commands
Section titled “Commands”Commands: Player: Command: "afkzone" Aliases: - "afk" - "afkzones" Admin: Command: "afkzoneadmin" Aliases: - "afkadmin" - "afkzonesadmin" Shop: Command: "shardshop" Aliases: - "shardsshop"The names and aliases of the three commands. Use lowercase letters, digits, _ or -, without the
leading /. No name or alias may repeat across the three commands, or the plugin refuses to enable.
| Key | Default | Description |
|---|---|---|
Player.Command / Player.Aliases |
afkzone / afk, afkzones |
The player command. |
Admin.Command / Admin.Aliases |
afkzoneadmin / afkadmin, afkzonesadmin |
The admin command. Hidden from tab completion for players without optimalafkzone.admin. |
Shop.Command / Shop.Aliases |
shardshop / shardsshop |
Opens the default shop directly. |
The help panels, ZONE-CREATED-NO-SPAWN and NO-IDLE-AREAS show the configured names through
{command}, {admin-command} and {shop-command}.
Teleport
Section titled “Teleport”The warmup before /afkzone and the AFK Zones menu teleport a player into a zone. See
Teleports & Auto-AFK.
Teleport: Warmup: 5 Cancel-On-Move: true Cancel-On-Damage: true Display: Type: ACTION_BAR Interval: 20 Action-Bar: "{progress-bar} &r&7- &d&l{seconds}s" Boss-Bar: Title: "&5&lTELEPORTING &7- &d{seconds}s" Color: PURPLE Style: PROGRESS Progress-Bar: Filled: "&d|" Empty: "&7|" Length: 20| Key | Default | Description |
|---|---|---|
Warmup |
5 |
Seconds before the teleport. 0 teleports at once. Players with optimalafkzone.bypass.warmup always skip it. |
Cancel-On-Move |
true |
Cancel the warmup when the player moves. |
Cancel-On-Damage |
true |
Cancel the warmup when the player takes damage. |
Display.Type |
ACTION_BAR |
Where the countdown shows: ACTION_BAR, BOSS_BAR, BOTH or NONE. |
Display.Interval |
20 |
Ticks between countdown updates. At least 1. |
Display.Action-Bar |
- | The action bar text. |
Display.Boss-Bar.Title |
- | The boss bar text. |
Display.Boss-Bar.Color / Style |
PURPLE / PROGRESS |
Same values as a zone’s boss bar. |
Display.Progress-Bar.Filled / Empty |
&d| / &7| |
The characters {progress-bar} is built from. |
Display.Progress-Bar.Length |
20 |
How many characters {progress-bar} has. At least 1. |
Boss-Bar and Progress-Bar are required even when the type does not use them. The texts accept
{seconds} (seconds left), {progress-bar}, {zone}, {zone-id}, {reward-time}, {world} and
{players}.
Auto-AFK
Section titled “Auto-AFK”Sends players who idle in an idle area to a random zone. See Teleports & Auto-AFK.
Auto-AFK: Enabled: true Idle-Time: 300 Regions: {}| Key | Default | Description |
|---|---|---|
Enabled |
true |
Master switch. |
Idle-Time |
300 |
Seconds without activity before a player is sent. At least 1. |
Regions |
{} |
The idle areas, by name. Each has the World, Min and Max of a zone Region. Auto-AFK is off while this is empty. |
Manage Regions in-game with /afkzoneadmin idlearea add|remove|list. Those commands rewrite this
section of config.yml and apply at once.
Shop: Enabled: true Default-Shop: "shards" Confirm-Purchase: true| Key | Default | Description |
|---|---|---|
Enabled |
true |
Master switch. When false, opening the shop replies SHOP-DISABLED. |
Default-Shop |
shards |
The shops/ file (without .yml) that /shardshop and /afkzone shop open. A name that matches no loaded shop also replies SHOP-DISABLED. |
Confirm-Purchase |
true |
Open the confirm menu before buying. false buys on the first click. |
The shop’s flash icons (Insufficient-Funds, No-Permission) live in each shop file under
Menu.Temporary-Icons, not here.
Inventories-Sounds
Section titled “Inventories-Sounds”Named sounds in "NAME;volume;pitch" form. Names are XSound names, which stay stable across
Minecraft versions. A missing key plays nothing.
Inventories-Sounds: "SHOP-OPEN": "BLOCK_CHEST_OPEN;1;1.2" "CONFIRM-OPEN": "UI_BUTTON_CLICK;1;1.4" "PURCHASE": "ENTITY_PLAYER_LEVELUP;1;1.6" "CLICK": "UI_BUTTON_CLICK;0.6;1.5" "PAGE-CHANGED": "ITEM_BOOK_PAGE_TURN;1;1" "NO-PAGE-FOUND": "BLOCK_NOTE_BLOCK_PLING;1;0.7" "FAILURE": "ENTITY_VILLAGER_NO;1;1" "ZONE-REWARD": "ENTITY_EXPERIENCE_ORB_PICKUP;1;1.2" "SHARDS-EARNED": "BLOCK_AMETHYST_BLOCK_CHIME;0.7;1.4" "BOOSTER-ACTIVATED": "ENTITY_PLAYER_LEVELUP;1;1.2" "WAND-SELECT": "BLOCK_NOTE_BLOCK_PLING;0.7;1.8" "ZONES-OPEN": "BLOCK_CHEST_OPEN;1;1.2" "TELEPORT-START": "BLOCK_NOTE_BLOCK_PLING;1;1.2" "TELEPORT-TICK": "BLOCK_NOTE_BLOCK_HAT;0.6;1.6" "TELEPORTED": "ENTITY_ENDERMAN_TELEPORT;1;1.2" "TELEPORT-CANCELLED": "ENTITY_VILLAGER_NO;1;1"| Key | Played when |
|---|---|
SHOP-OPEN |
The shop menu opens. |
CONFIRM-OPEN |
The confirm menu opens. |
ZONES-OPEN |
The AFK Zones menu opens. |
PURCHASE |
A purchase succeeds. |
CLICK |
A zone is clicked in the AFK Zones menu, or the cancel button in the confirm menu. |
PAGE-CHANGED |
A [next]/[previous] button turns the page. |
NO-PAGE-FOUND |
A page button is clicked with no page in that direction. |
FAILURE |
A purchase is refused, or a zone in the menu cannot be joined. |
ZONE-REWARD |
A zone pays out (every payout). |
SHARDS-EARNED |
A payout grants shards. |
BOOSTER-ACTIVATED |
A booster item is redeemed. |
WAND-SELECT |
A wand corner is set. |
TELEPORT-START |
A teleport warmup starts. |
TELEPORT-TICK |
Every second of the warmup. |
TELEPORTED |
A player arrives in a zone by teleport (also auto-AFK and admin tp). |
TELEPORT-CANCELLED |
A warmup is cancelled by moving or damage. |
Upgrading from an older version
Section titled “Upgrading from an older version”An older config.yml is updated on the first start, written back and logged in the console:
Settings.Number-Formatis added, withDefaulttaken from the oldShards.Abbreviate-Numbers. The oldShards.FormatandShards.Abbreviate-Numbersare removed (a customFormatpattern logs a warning: set theSeparatedblock to match it).Settings.Storageis added with SQLite.Currencyis added, withDisplay-Nametaken from the oldShards.Name-Plural. The oldShards.Name-SingularandName-Pluralare removed.- Missing
Commands,TeleportandAuto-AFKsections get the defaults. - An
Inventories-Soundssection without any of the new sounds getsZONES-OPENand the fourTELEPORT-*sounds.
guis/zones.yml is created with the defaults if it is missing. Shops are migrated too, see
shops.
