Skip to content

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
  • 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).

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"
  1. Starting a teleport closes any open menu, sends TELEPORT-WARMUP and plays TELEPORT-START.
  2. Every second plays TELEPORT-TICK, and the countdown shows in the action bar, the boss bar or both.
  3. Moving (with Cancel-On-Move) or taking damage (with Cancel-On-Damage) cancels it with TELEPORT-CANCELLED-MOVE or TELEPORT-CANCELLED-DAMAGE and the TELEPORT-CANCELLED sound.
  4. 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-UNAVAILABLE and stay put. Otherwise they arrive at the spawn with ZONE-TELEPORTED and the TELEPORTED sound.

Warmup: 0 teleports at once. Players with optimalafkzone.bypass.warmup (default: op) always skip the warmup.

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.

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.

Select the area with the wand (/afkzoneadmin wand), then:

/afkzoneadmin idlearea add spawn

The 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 area
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.

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.

  • 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.