Description
Features
- Automatic AFK Detection: Monitors player movement, chat, and mouse clicks.
- Customizable Thresholds: Set how long a player can be idle before being kicked.
- Warning System: Sends a customizable warning message before the kick occurs.
- Pre-Kick Notification: Sends a final "You have been kicked" message 2 seconds before disconnection for a better user experience.
- Permission Bypass: Exempt specific players or groups from being kicked using the
afkkick.bypasspermission. - Configurable: All messages and timings are easily adjustable via
mods/AFKKICK/config.json.
Known Issues
- Kick Screen Sync: Sometimes, even after a player is successfully kicked from the server, the Hytale client may still appear connected and fail to show the kick screen. This seems to be a issus with hytale it self
Configuration
The plugin creates a configuration file at mods/AFKKICK/config.json. Below is an example of the default configuration:
{
"afkThresholdMs": 300000,
"checkIntervalMs": 5000,
"kickMessage": "You have been kicked for being AFK for too long.",
"warningMessage": "You will be kicked for being AFK in 30 seconds! Move to stay connected.",
"warningThresholdMs": 30000,
"chatPreKickMessage": "You have been kicked for being AFK.",
"chatPreKickDelayMs": 2000
}
Configuration Values Explained:
- afkThresholdMs: Total time (in milliseconds) a player can be idle before being kicked. Default is 300,000 (5 minutes).
- checkIntervalMs: How often the plugin checks player activity (in milliseconds). Default is 1,000 (1 second).
- kickMessage: The message displayed on the player's screen after being kicked.
- warningMessage: The message sent to the player's chat when they are close to the AFK limit.
- warningThresholdMs: Time (in milliseconds) before the kick when the warning message is sent. Default is 30,000 (30 seconds before kick).
- chatPreKickMessage: A final chat message sent to the player immediately before the kick occurs.
- chatPreKickDelayMs: Time (in milliseconds) before the kick when the pre-kick message is sent. Default is 2,000 (2 seconds before kick).
Permissions
afkkick.bypass: Players with this permission will not be kicked for being AFK.
Installation
- Place the
AFKKick.jarin your server'smodsfolder. - Restart the server to generate the configuration file.
- Customize the
config.jsoninmods/AFKKICK/to your liking.


