Module: AFK - Module ID: afk

Introduction

The AFK module allows a user to mark themselves as “away from keyboard”. This can be a manual process, or an automatic process after an admin defined number of seconds.

Configuration

There are two entries in the main.conf file in the afk section:

  • afktime: time in seconds that a player is inactive before the player automatically gets marked as AFK. Defaults to 300 seconds. Set to 0 to disable.
  • afktimetokick: time in seconds that a player is inactive before the player automatically gets kicked. Defaults to disabled - set to 0 to disable.

Per-user/group AFK limits

Nucleus also makes use of permission options to be able to set different limits on different groups. They are:

  • nucleus.afk.toggletime: the same as afktime in the configuration, but for a specific group.
  • nucleus.afk.kicktime: the same as afktimetokick in the configuration, but for a specific group.

Consult your permissions plugin for how to set these, for convenience, the relevant commands for popular plugins are below:

Loading...
Loading...

Note: using /afkrefresh

Because AFK has the potential to do a lot of permission checks, Nucleus caches player permissions for two minutes at a time. If you change a player’s group and it affects their AFK permissions, run /afkrefresh. Nucleus will discard the cache and recheck all permissions as needed.

The following are incompatibilities that may occur with this module, along with how to resolve the problem. For the full mod/plugin incompatibility list, see the compatibility page.

No plugin incompatibilities have been reported.

/afk
Module: afk
Toggles the player's AFK state.

Aliases: afk away

Root command aliases: /nafk

Usage: /afk

Default Role: USER

Basic Command Permission: nucleus.afk.base

Permissions

  • nucleus.afk.notify - Default Role: ADMIN
    If kick notifications are not sent to the server, players with this permission will still get these notifications.
  • nucleus.afk.base - Default Role: USER
    Allows the user to run the command /afk
  • nucleus.afk.exempt.kick - Default Role: ADMIN
    Prevents the user from being kicked for being AFK for too long.
  • nucleus.afk.exempt.toggle - Default Role: NONE
    Prevents the user from going AFK.

This command is an equivalent to the following command(s) in Essentials: /afk, /away

/afkkick
Module: afk
Kicks all currently AFK players.

This command will not kick anyone with the afk kick exemption permission.

Aliases: afkkick kickafk

Root command aliases: /nafkkick

Usage: /afkkick [<reason…>]

Default Role: ADMIN

Basic Command Permission: nucleus.afkkick.base

Permissions

  • nucleus.afkkick.base - Default Role: ADMIN
    Allows the user to run the command /afkkick
/afkrefresh
Module: afk
Invalidates the AFK permission cache.

This asks Nucleus to invalidate the AFK permission cache, use this if you alter an online player's permissions.

Aliases: afkrefresh

Root command aliases: /nafkrefresh

Usage: /afkrefresh

Default Role: ADMIN

Basic Command Permission: nucleus.afkrefresh.base

Permissions

  • nucleus.afkrefresh.base - Default Role: ADMIN
    Allows the user to run the command /afkrefresh
  • nucleus.afkrefresh.exempt.warmup - Default Role: ADMIN
    Allows the user to bypass the warmup for /afkrefresh
  • nucleus.afkrefresh.exempt.cooldown - Default Role: ADMIN
    Allows the user to bypass the cooldown for /afkrefresh
  • nucleus.afkrefresh.exempt.cost - Default Role: ADMIN
    Allows the user to bypass the cost for /afkrefresh
Permission Suggested Role Description
nucleus.afk.base USER Allows the user to run the command /afk
nucleus.afk.exempt.kick ADMIN Prevents the user from being kicked for being AFK for too long.
nucleus.afk.exempt.toggle NONE Prevents the user from going AFK.
nucleus.afk.notify ADMIN If kick notifications are not sent to the server, players with this permission will still get these notifications.
nucleus.afkkick.base ADMIN Allows the user to run the command /afkkick
nucleus.afkrefresh.base ADMIN Allows the user to run the command /afkrefresh
nucleus.afkrefresh.exempt.cooldown ADMIN Allows the user to bypass the cooldown for /afkrefresh
nucleus.afkrefresh.exempt.cost ADMIN Allows the user to bypass the cost for /afkrefresh
nucleus.afkrefresh.exempt.warmup ADMIN Allows the user to bypass the warmup for /afkrefresh
The following configuration is the default for this module:
# The amount of time, in seconds, of inactivity before the player will be marked as AFK. Set to 0 to disable, or use the permission "nucleus.afk.exempt.toggle".
afk-time=300
# The amount of time, in seconds, of inactivity before the player will be kicked. Set to 0 to disable, or use the permission "nucleus.afk.exempt.kick".
# 
# Note that this is not time since going AFK, but time since last activity. Setting this to the same value as "afktime" will cause someone who goesAFK to be kicked instantly.
afk-time-to-kick=0
# If true, any player that tries to use a command that might require the target to do something will be told if the target is AFK.
alert-on-command-send=true
# If true, the server will always announce when players go AFK, even when vanished. If false, players who are vanished and go AFK will not have this status broadcasted.
broadcast-afk-when-vanished=false
# If true, the server will be informed when a player is kicked for inactivity, else, just those with the nucleus.afk.notify permissions
broadcast-to-all-on-kick=true
# If true, a player in spectator mode will not have their status broadcasted to players, nor will they be kicked for going AFK. Those with the notify permission will still see the AFK messages.
disable-in-spectator-mode=false
# If any of the messages tht would be broadcast to the server are blank, they will not be sent.
messages {
    # The message sent to a player when kicked for inactivity.
    kick-message-to-subject="You have been kicked for being AFK for too long."
    on-afk="&7*&f{{displayname}} &7has gone AFK."
    on-command="&f{{displayname}} &7is currently AFK and may not respond quickly."
    # If empty, no message will be sent.
    on-kick="&f{{displayname}} &7has been kicked for being AFK too long."
    on-return="&7*&f{{displayname}} &7is no longer AFK."
}
# Determines what actions determines if a player is active.
triggers {
    # Marks a player as active if they chat
    on-chat=true
    # Marks a player as active if they run a command
    on-command=true
    # Marks a player as active if they interact
    on-interact=true
    # Marks a player as active if they move
    on-movement=true
    # Marks a player as active if they rotate (that is, look around)
    on-rotation=true
}