Skip to content

Creating AFK Zones

Select a region with the wand, create AFK zones in-game, set their spawn and tune their rewards.

Zones are created in-game, with no coordinates to type and no restart. You need optimalafkzone.admin.

/afkzoneadmin wand
  • Left-click a block → position 1
  • Right-click a block → position 2

Each click sends POSITION-SET and plays the WAND-SELECT sound. The two positions are opposite corners of a cuboid, and a live particle outline follows your selection. Breaking blocks with the wand in hand is blocked, so a left-click never destroys the corner you picked.

A player counts as inside the zone when the block at their feet is inside the cuboid (both corners included). Pick corners that cover the floor and enough height above it.

Stand inside your selection, where players should arrive, and run:

/afkzoneadmin create spawn

The zone id may use lowercase letters, digits, _ and -, up to 32 characters. Both positions must be set and in the same world.

The plugin takes its built-in zone template, writes your Region, a display name (&d&lSpawn) and, because you stand inside the region, a Spawn at your position and facing. It saves the result as zones/spawn.yml. The zone is live immediately: stand inside to see the enter message, the action bar and the boss bar countdown. Your selection is cleared.

Players can only teleport to zones that have a spawn. If you ran create from outside the selection, the zone has none yet and you get ZONE-CREATED-NO-SPAWN as a reminder. Walk into the zone and run:

/afkzoneadmin setspawn spawn

The spawn is your exact position and facing. It has to be inside the zone, or you get SPAWN-OUTSIDE-ZONE. Run it again at any time to move the spawn. /afkzoneadmin list shows which zones still have no spawn.

A zone without a spawn still works for players who walk in. It is just not offered by /afkzone, the AFK Zones menu or auto-AFK. See Teleports & Auto-AFK.

Open zones/spawn.yml and change what you need, then run /afkzoneadmin reload. The most common edits:

Settings:
Display-Name: "&d&lSpawn AFK"
Reward-Time: 300 # pay every 5 minutes
Reward-Mode: "Both" # Shards, Commands or Both
Permission: "" # e.g. "afk.vip" for a VIP-only zone
Shards:
Enabled: true
Amount: 5 # shards per payout, before boosters
Chance: 100.0
Rewards:
money:
Chance: 80
Actions:
- "eco give %player% 250"
key:
Chance: 20
Actions:
- "crates key give %player% vote 1"
- "[message] &5[&d&lAFK&5] &7You found a &dVote Key&7!"

Players keep their progress across a reload. Changes, including an added or removed Permission, apply on the next tick.

To give the zone its own icon in the AFK Zones menu, add an Icon item to the file, see the zones reference.

Reward-Mode Each payout
Shards Only the zone’s Shards payout.
Commands Only the zone’s Rewards.
Both Shards, then Rewards.

With Random-Rewards: true one reward group is rolled by Chance (a weight, not a percentage); with false every group runs on every payout.

If Shards.Enabled is false in config.yml, shards are off server-wide and every zone always runs its Rewards, whatever its mode.

/afkzoneadmin list # every zone, its world, timer, occupants and spawn
/afkzoneadmin tp spawn # teleport to the zone's spawn (or the top centre without one)
/afkzoneadmin setspawn spawn # move the spawn to where you stand
/afkzoneadmin outline spawn # toggle the zone's particle outline for yourself
/afkzoneadmin delete spawn # delete the zone and its file
/afkzoneadmin reload # apply config edits, keeps active sessions
  • Resizing: edit the Region corners in the zone file and reload, or delete the zone and create it again from a new selection. Make sure the Spawn is still inside.
  • Disabling without deleting: Settings.Enabled: false keeps the file, but nobody can enter the zone and it is not offered to players.
  • Overlaps: a player is only ever in one zone, the one with the higher Settings.Priority. Moving from one zone into another runs the first zone’s Leave-Actions and the second zone’s Enter-Actions.
  • Files starting with _ in zones/ are ignored, so you can park a copy as _spawn.yml.
  • Broken zone files are skipped with a console error naming the file and the problem. The other zones still load.
  • The template is built in. New zones always start from the plugin’s own template, not from a file in zones/. To give a new zone the settings of an existing one, copy the sections you want from the old file into the new one, keeping the new file’s Region and Spawn.