Content generated with AI — it may contain mistakes.

ExyliaStaff/GuidesUpdated in v1.8.0

Track idle players

Detect who is away from the keyboard so random teleport skips them and the staff sidebar counts them.

Page 20 of 382 min read

ExyliaStaff knows which players are actually at the keyboard. Random teleport stops dropping staff onto empty bodies, the staff sidebar can say how much of the player count is real, and Exylia Staff Web flags idle players.

Before you start#

  • There is no command and no permission: the answer is read from what the player does, not a state they set.
  • The module switch is modules.afk in plugins/ExyliaStaff/config.yml, on by default. Its setting is in plugins/ExyliaStaff/modules/afk/config.yml.

Steps#

Pick the idle time

In modules/afk/config.yml set after-seconds. The default is 300: five minutes without moving a block, interacting, chatting or typing a command before a player counts as AFK.

Show it in the sidebar

The staff sidebar already has a line AFK » %staff_afk_count% (see Placeholders). Add the placeholder to any other board that reads PlaceholderAPI.

Skip idle players when teleporting

In modules/teleport/config.yml, random-skip-afk is true by default; set it to false to stop skipping. Random teleport then skips idle players. That key needs this module: with the AFK module off, nobody is skipped for being idle.

Check that it works#

Stand still on a test account for longer than after-seconds, then read %exyliastaff_staff_afk_count% with /papi parse me %exyliastaff_staff_afk_count%: it goes up by one. Move and it goes back down at once.

Going further#

How idle is measured#

ExyliaStaff keeps one timestamp per online player. Moving a block, interacting, chatting or typing a command marks them as at the keyboard, and a player who just joined counts as present whatever they did last session. The answer is the time between now and that timestamp, so nothing runs on a timer and the cost does not grow with the player count. The timestamp is written at most once a second per player.

The staff log counts staff-mode time as AFK with its own threshold, afk-after-seconds; changing one does not change the other.

Placeholders#

Both resolve off the main thread, so a sidebar can read them on its own refresh.

PlaceholderShowsExample
%exyliastaff_staff_afk_count%Idle players on this server.4
%exyliastaff_staff_afk_is%true while you have been idle longer than afk-after-seconds.false

Something missing on this page? Tell us on Discord