The AFK module allows you to track inactive online players, visually mark them in the TAB list (or anywhere else using a global placeholder), and perform automated actions upon them.
WakeUp
This section controls how a player leaves AFK mode. To prevent accidental wake-ups from tiny movements, players must reach a certain activity threshold within a short time limit. They can earn activity points by moving, typing in chat, or interacting with the world. You can also run console commands right as the player wakes up.
WakeUp:
# Sets the activity threshold that a player must reach to lose the AFK mode.
Threshold: 5
# The duration (in seconds) a player has to meet the activity threshold to leave AFK mode.
# If the player does not meet the threshold within this time, the timer and activity points reset, and they remain AFK until the next cycle.
Timeout: 5
# The following commands will be dispatched right before player leave AFK mode.
# [*] Placeholders: '%player_name%', PlaceholderAPI
Commands: []
# Sets how much activity points produced by certain player actions.
Activity-Points:
MOVEMENT: 1
CHAT: 5
INTERACT: 1
COMMAND: 3
AFK
This handles everything about entering AFK mode and what happens while a player is away. You can set up automatic idle timers and even configure the server to kick players if they are gone for way too long. It also features a cooldown to stop players from instantly going AFK again, custom placeholders to use in other modules/plugins, and an on-screen status message.
Permission Based Timers
You can give different idle and kick times to different ranks! Use the RANK mode for your permission groups, or PERMISSION mode to use specific permission nodes. Set a time to -1 to make a player completely immune to being marked as AFK or kicked.
AFK:
# The cooldown period (in seconds) after a player leaves AFK mode.
# During this time, the player will be immune to being marked as inactive, even if they produce no activity.
Cooldown: 60
# Here you can set the inactivity time (in seconds) after which a player will be placed into AFK mode.
# You can set different times for different ranks or permissions (read comments).
# If multiple times are available, the greatest (or negative) one will be used.
# Use '-1' to make players immune to the auto-AFK mode.
Idle_Time:
Mode: RANK
Permission_Prefix: sunlight.afk.idletime.
Default_Value: 300
Values:
gold: 900
vip: 600
# Here you can set the total inactivity time (in seconds) after which a player will be kicked from the server.
# [*] IMPORTANT: This value sets the TOTAL time (Time before AFK + Time after AFK), not just the time starting from when the player entered AFK mode.
# If multiple times are available, the greatest (or negative) one will be used.
# Use '-1' to make players immune from being kicked due to AFK.
Kick_Time:
Mode: RANK
Permission_Prefix: sunlight.afk.kicktime.
Default_Value: 1200
Values:
vip: 1500
gold: 1800
admin: -1
# Kick message for players kicked for being AFK long enough.
# [*] Placeholders: '%time%', PlaceholderAPI
Kick_Message:
- '<lred>You have been kicked for being AFK too long: <lorange>%time%</lorange></lred>'
- ''
- <lgreen><u>You can join back now.</u></lgreen>
# The following commands will be dispatched right before player enter AFK mode.
# [*] Placeholders: '%player_name%', PlaceholderAPI
Commands: []
Status-Bar:
# Controls whether AFK status bar is enabled for AFK players.
Enabled: true
# Set AFK status bar message for AFK players.
# [*] Placeholders: '%time%', PlaceholderAPI
Text: <dark_gray>[<orange>AFK</orange>]</dark_gray> <gray>You're being AFK for </gray><orange>%time%</orange>
Commands
The table below shows default command settings. Please see the Commands Guide on how to toggle and customize SunLight's commands.