
š”ļø AfkDetector
AfkDetector is a lightweight, low-impact AFK detection plugin for Hytale servers.
It monitors player activity using horizontal movement sampling, marks players as AFK after a configurable idle period, optionally warns them, and can safely kick idle players using the serverās native command system.
Designed to be:
- ā” Performant
- š Reloadable
- š§° Admin-friendly
⨠Features
- Detects AFK players based on player movement
- Seconds-based configuration (no millisecond spam)
- Live config reload (
/afk reload)
- AFK status command (
/afk)
- Reset AFK timer (
/afk reset)
- List AFK players (
/afk whois)
- Optional automatic kicking
- Permission-based bypass (no kicks for admins)
- Reload-safe scheduling (no server restart required)
š¦ Installation
- Build the plugin JAR
- Place the JAR into your serverās
mods/ directory
- Start the server
- Edit
config.json in the plugin data folder
- Reload the plugin with: /afk reload
āļø Configuration (config.json)
All values are seconds-based for readability and minimal server impact.
{
"checkEverySeconds": 5,
"afkAfterSeconds": 180,
"kickEnabled": false,
"kickAfterSeconds": 600,
"warnBeforeKickSeconds": 30,
"moveEpsilon": 0.08,
"afkMessage": "[AFK] You are now AFK.",
"backMessage": "[AFK] Welcome back!",
"warnMessage": "[AFK] Move or you will be kicked soon.",
"kickMessage": "Kicked for being AFK too long.",
"bypassPermission": "afk.bypass",
"reloadPermission": "afk.reload",
"enableCommand": true
}
āØļø Commands
| Command |
Description |
/afk |
Shows your AFK status |
/afk reset |
Resets your AFK timer |
/afk reload |
Reloads config.json |
/afk whois |
Lists all AFK players |
/afk whois <name> |
Shows AFK status for a specific player |
Permissions
| Permission |
Description |
afk.bypass |
Exempt from AFK kicks |
afk.reload |
Allows /afk reload and /afk whois |
How It Works
- Players are checked at configurable interval (default 5 seconds)
- Horizontal Movement beyond a small threshold counts as activity
- After being idle long enough, players are marked AFK
- Optional warnings and kicks use the native server command
- All logic runs safely on the world thread
Comparability & Design
- Designed for modern Hytale server builds
- Avoids fragile API dependencies
- Uses reflection where APIs differ between version
- Safe to reload without restarting server.