zones
Reference for a zone file in zones/ - settings, region, protection, shards, displays, actions and rewards.
Every zone is one file, zones/<id>.yml, and the file name is the zone id. Files are created by
/afkzoneadmin create <id> from the plugin’s built-in template, shown in full below. After editing a
zone, run /afkzoneadmin reload.
A walkthrough is in Creating AFK Zones; this page is the full field reference.
Settings: Enabled: true Display-Name: "&d&lAFK Zone" Permission: "" Reward-Time: 60 Random-Rewards: true Reward-Mode: "Both" Reset-Progress-On-Leave: true Priority: 0
Region: World: "world" Min: X: 0 Y: 0 Z: 0 Max: X: 0 Y: 0 Z: 0
Protection: Prevent-Damage: true Prevent-Hunger: true Prevent-Mob-Targeting: true
Shards: Enabled: true Amount: 1 Chance: 100.0
Action-Bar-Settings: Enabled: true Interval: 40 Format: "&d&lAFK &8» &7Next reward in &d{next} &8» &7Shards: &d{shards}"
Boss-Bar-Settings: Enabled: true Title: "&d&lAFK ZONE &8» &7Next reward in &d{next}" Color: "PURPLE" Style: "PROGRESS" Progress: true
Enter-Actions: - "[message] &5[&d&lAFK&5] &7You are now AFK in &d{zone}&7." - "[message] &5[&d&lAFK&5] &7You will be rewarded every &d{reward-time}s&7." - "[title] &d&lAFK ZONE;&7Enjoy your stay;10;40;10" - "[sound] BLOCK_AMETHYST_BLOCK_CHIME;1;1.2"
Leave-Actions: - "[message] &5[&d&lAFK&5] &7You have left &d{zone}&7." - "[sound] BLOCK_AMETHYST_BLOCK_BREAK;1;0.8"
Rewards: reward1: Chance: 60 Actions: - "eco give %player% 25" reward2: Chance: 25 Actions: - "eco give %player% 50" reward3: Chance: 15 Actions: - "eco give %player% 100" - "coins give %player% 50"create writes your selection into Region and sets Display-Name to &d&l plus the id with a
capital first letter. Everything else comes from the template above.
Settings
Section titled “Settings”Required.
| Key | Default | Description |
|---|---|---|
Enabled |
true |
false keeps the file loaded (it still shows in /afkzoneadmin list) but nobody can enter the zone. |
Display-Name |
the id, capitalised | Shown as {zone} in messages, actions and displays. |
Permission |
"" |
Node required to use the zone. Empty means public. A player without it gets ZONE-NO-ACCESS once on entry and nothing else: no time, no payouts, no displays, no protection. |
Reward-Time |
60 |
Seconds between payouts. Minimum 1. |
Random-Rewards |
true |
true rolls one Rewards group by weighted Chance. false runs every group on each payout. |
Reward-Mode |
Both |
What a payout grants: Shards (only the Shards payout), Commands (only Rewards) or Both. Case does not matter. Any other value, or an empty one, fails the zone load. |
Reset-Progress-On-Leave |
true |
true resets progress toward the next payout when the player leaves. false remembers it until they come back (until they log out). |
Priority |
0 |
When zones overlap, the highest priority wins. |
If Shards.Enabled in config.yml is false, every
zone runs its Rewards and pays no shards, whatever its Reward-Mode.
Region
Section titled “Region”Required. The cuboid, normally written by /afkzoneadmin create.
| Key | Description |
|---|---|
World |
The world name. Required. |
Min.X / Min.Y / Min.Z |
One corner, in block coordinates. |
Max.X / Max.Y / Max.Z |
The opposite corner. |
Both corners are inclusive, and the order does not matter: the plugin uses the smaller and larger value on each axis. A player is inside when the block at their feet is. Edit the numbers and reload to resize a zone.
Protection
Section titled “Protection”Optional. Protections apply only to players in the zone with access to it.
| Key | Template | Description |
|---|---|---|
Prevent-Damage |
true |
Cancel all damage to the player. |
Prevent-Hunger |
true |
Stop the food bar from going down (eating still works). |
Prevent-Mob-Targeting |
true |
Stop mobs from targeting the player. |
A missing key, or a missing Protection section, means false.
Shards
Section titled “Shards”Optional. The shard payout of this zone, used when Reward-Mode is Shards or Both.
| Key | Default | Description |
|---|---|---|
Enabled |
true |
Whether this zone pays shards. |
Amount |
1 |
Base shards per payout. Multiplied by the player’s booster, rounded, never below 1. 0 pays nothing. |
Chance |
100.0 |
Percent chance that a payout includes the shards. |
Without a Shards section the zone pays no shards.
Action-Bar-Settings
Section titled “Action-Bar-Settings”Optional. Without the section, or with Enabled: false, there is no action bar.
| Key | Default | Description |
|---|---|---|
Enabled |
false when missing |
Show the action bar. The template enables it. |
Interval |
40 |
Ticks between sends, independent of Check-Interval. Minimum 1. Clients fade the bar after about 60 ticks, so 40 keeps it solid at half the packets of 20. |
Format |
"" |
The action bar text. |
Boss-Bar-Settings
Section titled “Boss-Bar-Settings”Optional. Without the section, or with Enabled: false, there is no boss bar.
| Key | Default | Description |
|---|---|---|
Enabled |
false when missing |
Show the boss bar. The template enables it. |
Title |
"" |
The boss bar text. |
Color |
PURPLE |
PINK, BLUE, RED, GREEN, YELLOW, PURPLE or WHITE. |
Style |
PROGRESS |
PROGRESS, NOTCHED_6, NOTCHED_10, NOTCHED_12 or NOTCHED_20 (SOLID and SEGMENTED_* also work). |
Progress |
true |
true drains the bar toward the next payout. false keeps it full. |
An invalid Color or Style fails the zone load. The bar is hidden when the player leaves the zone.
Both displays take {next}, {percent}, {zone}, {zone-id}, {reward-time}, {players},
{session}, {total}, {shards}, {currency} and {player}, see
Information → Displays.
Enter-Actions / Leave-Actions
Section titled “Enter-Actions / Leave-Actions”Optional lists, run when a player with access enters or leaves the zone. They use the shared
action syntax, and also get {zone}, {zone-id},
{reward-time} and {players}.
Rewards
Section titled “Rewards”Optional. Named groups, each with a Chance and a list of Actions. The group names are free-form.
Rewards: money: Chance: 80 Actions: - "eco give %player% 250" rare-key: Chance: 20 Actions: - "crates key give %player% rare 1" - "[broadcast] &d%player% &7found a &dRare Key &7while AFK!"| Key | Description |
|---|---|
Chance |
The group’s weight when Random-Rewards: true. Weights are relative and need not add up to 100. Ignored when Random-Rewards: false. |
Actions |
What the group does, in the shared action syntax. A line with no [tag] runs from console. |
With Random-Rewards: true and no group with a positive chance, nothing is rolled.
Load errors
Section titled “Load errors”A zone file that fails to load (missing Settings or Region, a region without World, an invalid
Reward-Mode, Color or Style, a malformed [title] action) is skipped with a console error
naming the file. The other zones load normally.
