Download (3 KB)

How do I install this?

API to check player AFK status

Want to know that is a player away-from-keyboard? This mod is for you!

API Methods


Allow mods to report that the player is active at the time.

  • name: The name of the player


INTERNAL: Remove the record of a player. Should only call once when the player leaves.

  • name: The name of the player


Get the record of a specific player, return the AFK duration, or false if the player is not online.

  • name: The name of the player


Get list of AFK records. It returns a table, with player name as key and AFK duration as value.


Similar to afk_indicator.get_all(), but only return records with AFK duration longer than p.

  • p: The minimum AFK duration for the returned records.



A key-value pair of player names and AFK start time.

It's recommended to use afk_indicator.get_all() or afk_indicator.get(name), as it calculate the AFK time for you.



A command mostly for debugging purpose, showing the AFK time of the online players.

basic_privs is required to use this command.

Executing the chatcommand is also an action. Therefore, it's pointless to include the command executor's own AFK time as it's always 0.



Do you recommend this mod?

  • No reviews, yet.

Used By