promotional bannermobile promotional banner
premium banner
AfkDetector is a lightweight, low-impact AFK detection plugin for Hytale servers.

Description

AfkDetector Banner

šŸ›”ļø 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

  1. Build the plugin JAR
  2. Place the JAR into your server’s mods/ directory
  3. Start the server
  4. Edit config.json in the plugin data folder
  5. 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.