Compatibility
Minecraft: Java Edition
Platforms
Links
Creators
Details
Smart, Performance-Focused, and Comprehensive AFK Management System
AntiAFK is a next-generation management tool designed for modern Minecraft servers where standard AFK timers fall short. Its primary goal is not only to detect AFK players but also to proactively prevent the most complex bots and attempts to exploit AFK detection. With a design that prioritizes server performance, it operates unnoticed even on the busiest servers.
Visuals
Orbital Detection System (Behavior Analysis)
Orbital Detection System visuals.
Repeating Pointless Movements Continuously in the Same Block (Pointless Activity Analysis)
Pointless Activity System visuals.
GUI Display:
GUI System images.
✨ Key Features ✨
🧠 "Learning Mode": Intelligent Pattern Recognition
Leveraging machine learning principles, Learning Mode detects and counteracts sophisticated AFK bots that follow predefined movement patterns or routes. This system goes beyond simple activity checks to analyze how players move over time. A highly optimized, asynchronous task continuously compares the recent movements of all online players against a library of known bot patterns using the Dynamic Time Warping (DTW) algorithm, which effectively compares two movement sequences even if they are performed at different speeds.
- Asynchronous Pattern Analysis: A custom-built task runs entirely off the main server thread to perform computationally intensive DTW comparisons, ensuring zero server lag.
- High-Performance Design: Implements object pooling (Apache Commons Pool2) to significantly reduce garbage collection overhead and uses a lock-free queue to safely pass data between threads.
- Comprehensive Pattern Management: A new command suite,
/antiafk pattern, gives you full control to record, list, and manage bot patterns. - Dual Serialization Formats: Patterns can be saved in human-readable JSON (for debugging) or a highly efficient binary Kryo format for optimal performance.
Multi-Layered Detection Architecture
AntiAFK applies a four-layered analysis to detect AFK behavior and bots that mimic it:
- Layer 1: Classic Activity Monitoring: Monitors over 10 basic actions, including movement, chat, inventory, and world interaction.
- Layer 2: Pointless Actions Analysis: Counts non-movement actions repeated by the player while staying at the same block coordinates. When the threshold is exceeded, these actions are prevented from resetting the AFK timer.
- Layer 3: Macro and Exploit Detection: Detects clicking patterns that are too consistent to be human (Auto-Clicker) and exploits involving very fast position changes using portals/commands.
- Layer 4: Asynchronous Behavioral Analysis: Analyzes players' movement trajectories asynchronously, catching even bots that follow the most complex trajectories along a specific route.
“Turing Test” (Captcha Protection)
When suspicious behavior is detected, AntiAFK challenges the player:
- Smart Triggers: Automatically activate based on suspicious trajectory repetition or pointless action counts.
- Flexible Question-Answer System: Asks the player a random question from
questions.ymlto verify they are human. Supports multiple correct answers for each question. - Suspicious Mode: While a test is active, the bot's movements or clicks cannot reset the AFK timer, making it impossible for bots to bypass the test.
- Customizable Penalties: You can define custom commands such as
kickorbanfor players who fail the test.
Graduated Penalty and Record System
Provides a fair and effective penalty system:
- Persistent Data Storage (SQLite): Players' entire AFK history (number of penalties, total AFK time, captcha statistics) is permanently stored on the server.
- Graduated Penalties: For repeated AFK behavior, you can configure actions (warning, kick, temporary ban, etc.) that increase in severity based on the number of penalties.
- Automatic Penalty Reset: The records of players who have not caused problems for a long time are automatically cleared after a specified period.
🌍 Full Internationalization (i18n) Support
AntiAFK now speaks your language! The entire plugin has been overhauled to provide a truly multilingual experience.
- All Messages are Translatable: Every single message, including system logs, error messages, and in-game commands, is managed by the language system.
- Global Language Setting: Set the global language for all console output directly in
config.ymlusing thelangsetting. - Multiple Supported Languages: Comes with full support for Turkish, English, Spanish, German, French, Russian, and Polish.
- Easy Translation: To change the language for player-facing messages, simply replace your
messages.ymlfile with one from the provided language files. You can find all official translations here.
Comprehensive Management and Configuration
Provides full control to server owners:
- Administrator Commands: Provides access to all management tools through a single main command (
/antiafk).- panel: Opens a fully featured GUI to manage the plugin from within the game.
- reload: Reloads all configuration files.
- check <player>: Queries a player's detailed record and current status.
- top <time|punishments>: Displays AFK leaderboards.
- list: Lists players who are currently AFK.
- pattern <record|list|manage>: Manage the "Learning Mode" bot detection patterns.
- Flexible Configuration: All texts, commands, announcements, penalties, and detection mechanisms can be configured in detail via the
config.yml,messages.yml, andquestions.ymlfiles.
🚀 Performance
AntiAFK has been developed using the most modern techniques to keep its impact on server performance to an absolute minimum. It doesn't just show results, it transparently reveals how it achieves them:
- Asynchronous Operations: Computationally expensive operations, such as the behavioral and pattern analysis (DTW algorithm) and all database interactions, are executed entirely outside the server's main thread. This prevents disk I/O or intensive CPU usage from affecting the server's tick rate (TPS).
- Smart Caching (Caffeine): Frequently accessed data (player statistics, configuration values) is stored in high-performance caches to minimize database queries and file reads.
- Distributed Load: Periodic tasks spread their operations evenly across 20 ticks within a one-second timeframe, preventing sudden performance spikes on the server during high player counts.
Performance Profile (Spark Analysis)
Test Environment: Paper 1.19.4, 1 online player, standard server load.
// Server's overall idle rate (higher is better)
Server thread: 100.00%
└── net.minecraft.server.MinecraftServer.waitUntilNextTick(): 85.37%
// Plugin's total impact on the main thread
AntiAFK (v1.0.2)
└── Server thread: 0.24%
├── com.bentahsin.antiafk.tasks.AFKCheckTask.run(): 0.18%
├── com.bentahsin.antiafk.listeners.handlers.PlayerMovementListener.onPlayerMove(): 0.04%
└── Other (Commands, GUI, Captcha): 0.02%
Analysis:
- The fact that the server spends more than 85% of its time idle indicates that the plugin does not negatively impact overall server health.
- The total impact of all plugin components on the main thread is only ~0.24%. This is a statistically negligible value, confirming that it will not create a noticeable impact on TPS even on the busiest servers.
🔗 Integrations and Installation
Integrations:
- WorldGuard: Allows you to define completely different AFK durations and penalty actions for specific areas (arena, market, AFK room, etc.). (Optional)
- PlaceholderAPI: Share dynamic data such as
%antiafk_tag%,%antiafk_reason%with other plugins. (Optional) - ProtocolLib: Offers a more advanced user experience for features like text input within the GUI. (Optional)
Installation:
- Download the latest version here.
- Place the
.jarfile in your server'spluginsfolder. - Start the server to generate the default configuration files (
config.yml,messages.yml,questions.yml,playerdata.db). - Customize the configuration files as needed and use the
/antiafk reloadcommand.
GitHub Page | Report an Issue



