Teleports & Auto-AFK
How players reach AFK zones - the /afkzone teleport and warmup, the AFK Zones menu, and sending idle players to a zone automatically.
Players reach a zone in three ways: walking in, /afkzone, or being sent there by auto-AFK. The
last two only use zones that are listed: enabled and with a Spawn (see
Creating AFK Zones). A listed zone is joinable
by a player who also has its Permission.
/afkzone
Section titled “/afkzone”/afkzone- One joinable zone: the player is teleported to its spawn after the warmup.
- Several joinable zones: the AFK Zones menu opens.
- None:
NO-JOINABLE-ZONES.
/afkzone info shows the progress view (zone, next reward, session and total AFK time).
The warmup
Section titled “The warmup”Set in the Teleport section of config.yml:
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"- Starting a teleport closes any open menu, sends
TELEPORT-WARMUPand playsTELEPORT-START. - Every second plays
TELEPORT-TICK, and the countdown shows in the action bar, the boss bar or both. - Moving (with
Cancel-On-Move) or taking damage (withCancel-On-Damage) cancels it withTELEPORT-CANCELLED-MOVEorTELEPORT-CANCELLED-DAMAGEand theTELEPORT-CANCELLEDsound. - When it ends, the zone is checked again. If it was deleted, disabled or the player lost its
permission in the meantime, they get
ZONE-UNAVAILABLEand stay put. Otherwise they arrive at the spawn withZONE-TELEPORTEDand theTELEPORTEDsound.
Warmup: 0 teleports at once. Players with optimalafkzone.bypass.warmup (default: op) always skip
the warmup.
The AFK Zones menu
Section titled “The AFK Zones menu”guis/zones.yml lists every listed zone, page by page. Clicking a zone the player can join starts its
teleport; clicking one they lack the permission for flashes the No-Access icon and plays FAILURE.
The shipped menu also has a Random Zone button that picks a random joinable zone.
Each zone is drawn from the menu’s Zone-Item, or from the zone’s own Icon when its file has one.
Full reference: zones.yml.
Auto-AFK
Section titled “Auto-AFK”Players who stand still in an idle area for Idle-Time seconds are sent straight to a random
joinable zone, with no warmup, and get the AUTO-AFK message. Use it to move idlers out of spawn or
a hub.
1. Mark an idle area
Section titled “1. Mark an idle area”Select the area with the wand (/afkzoneadmin wand), then:
/afkzoneadmin idlearea add spawnThe selection is saved to config.yml under Auto-AFK.Regions.spawn and applies at once, no reload
needed. Area names follow the zone id rules: lowercase letters, digits, _ and -, up to 32
characters.
/afkzoneadmin idlearea list # every area, its world and size/afkzoneadmin idlearea remove spawn # delete an area2. Set the idle time
Section titled “2. Set the idle time”Auto-AFK: Enabled: true Idle-Time: 300 Regions: spawn: World: "world" Min: { X: -40, Y: 60, Z: -40 } Max: { X: 40, Y: 120, Z: 40 }Idle-Time is in seconds (at least 1). Auto-AFK does nothing while Regions is empty, so a fresh
install never moves anyone.
What counts as activity
Section titled “What counts as activity”Moving to another block, turning your head, chatting, running a command and interacting all reset the idle timer. Arriving in a zone by teleport counts too.
When a player is not sent
Section titled “When a player is not sent”- They are already in a zone. Only players outside every zone are checked.
- They are not standing in an idle area.
- They have a teleport warmup running.
- They have
optimalafkzone.bypass.autoafk(default: nobody). - No zone is joinable for them. Their idle timer restarts, so they are checked again after another
Idle-Time.
The check runs on the zone tick (Settings.Check-Interval), so it adds almost nothing to the server’s
load.
