智能、注重性能且全面的 AFK 管理系统
AntiAFK 是一款为现代 Minecraft 服务器设计的下一代管理工具,旨在解决标准 AFK 计时器无法胜任的场景。其核心目标不仅是检测挂机玩家,还要主动防范最复杂的机器人及利用 AFK 检测机制的尝试。该插件以服务器性能为设计优先项,即使在最繁忙的服务器上也能悄然运行而不被察觉。
视觉效果
轨道检测系统(行为分析)
轨道检测系统视觉效果。
在同一方块内不断重复无意义的动作(无意义活动分析)
无意义活动系统视觉效果。
GUI 显示:
GUI 系统图片。
✨ 主要功能 ✨
? “学习模式”:智能模式识别
借鉴机器学习原理,“学习模式”能够检测并反制遵循预定义移动模式或路线的高级 AFK 机器人。该系统超越了简单的活动检查,通过分析玩家随时间推移的移动方式来识别异常。一个高度优化的异步任务会持续使用动态时间规整(DTW)算法,将所有在线玩家的近期移动与已知机器人模式库进行比较,即使这些移动序列以不同速度执行,也能有效进行对比。
- 异步模式分析: 自定义构建的任务完全在服务器主线程之外运行,以执行计算密集的 DTW 比较,确保零服务器卡顿。
- 高性能设计: 实现对象池化(Apache Commons Pool2)以显著减少垃圾回收开销,并使用无锁队列安全地在线程间传递数据。
- 全面的模式管理: 新增命令套件
/antiafk pattern,让你能够完整控制记录、列出和管理机器人模式。 - 双序列化格式: 模式可以保存为人类可读的 JSON 格式(用于调试),或保存为高效二进制 Kryo 格式以获得最佳性能。
多层检测架构
AntiAFK 应用四层分析来检测 AFK 行为及模仿该行为的机器人:
- 第一层:经典活动监控: 监控超过 10 种基本动作,包括移动、聊天、物品栏和与世界互动。
- 第二层:无意义动作分析: 统计玩家在保持相同方块坐标时重复的非移动动作。当超过阈值时,这些动作将不再重置 AFK 计时器。
- 第三层:宏指令与漏洞检测: 检测过于一致、非人类所能完成的点击模式(自动点击器),以及涉及通过传送门/命令进行极快位置变化的漏洞利用。
- 第四层:异步行为分析: 异步分析玩家的移动轨迹,捕捉那些沿着特定路线遵循最复杂轨迹的机器人。
“图灵测试”(验证码保护)
当检测到可疑行为时,AntiAFK 会对玩家发起挑战:
- 智能触发: 基于可疑轨迹重复或无意义动作计数自动激活。
- 灵活的问答系统: 向玩家提出
questions.yml中的随机问题以验证其是否为人类。每个问题支持多个正确答案。 - 可疑模式: 在测试期间,机器人的移动或点击无法重置 AFK 计时器,使机器人无法绕过测试。
- 可定制的惩罚: 你可以为未通过测试的玩家定义自定义命令,例如
kick(踢出)或ban(封禁)。
分级惩罚与记录系统
提供公平且有效的惩罚机制:
- 持久数据存储(SQLite): 玩家的整个 AFK 历史记录(惩罚次数、总 AFK 时间、验证码统计数据)永久存储在服务器上。
- 分级惩罚: 对于重复的 AFK 行为,你可以配置根据惩罚数量增加严重程度的操作(警告、踢出、临时封禁等)。
- 自动重置惩罚记录: 长时间未造成问题的玩家记录会在指定时间段后自动清除。
? 全面国际化 (i18n) 支持
AntiAFK 现在支持你的语言!整个插件经过彻底重构,提供真正的多语言体验。
- 所有消息均可翻译: 每一条消息,包括系统日志、错误信息和游戏内命令,都由语言系统管理。
- 全局语言设置: 在
config.yml中使用lang设置直接为所有控制台输出设置全局语言。 - 多种支持语言: 完整支持 土耳其语、英语、西班牙语、德语、法语、俄语和波兰语。
- 轻松翻译: 要更改面向玩家的界面语言,只需将你的
messages.yml文件替换为提供的语言文件之一即可。你可以在 此处 找到所有官方翻译。
综合管理与配置
为服务器管理员提供完全的控制权:
- 管理员命令: 通过单一主命令(
/antiafk)提供对所有管理工具的访问权限。- panel:打开一个功能齐全的图形用户界面(GUI),以便在游戏中直接管理插件。
- reload:重新加载所有配置文件。
- check <player>:查询玩家的详细记录及当前状态。
- top <time|punishments>:显示挂机排行榜。
- list:列出当前处于挂机状态的玩家。
- pattern <record|list|manage>:管理“学习模式”下的机器人检测规则。
- 灵活配置: 所有文本、命令、公告、惩罚机制以及检测方式均可通过
config.yml、messages.yml和questions.yml文件进行详细配置。
? 性能
AntiAFK 采用最新技术开发,旨在将对服务器性能的影响降至绝对最低。它不仅展示结果,还透明地揭示了其实现方式:
- 异步操作: 计算密集型操作,如行为分析和模式分析(DTW 算法)以及所有数据库交互,均在服务器主线程之外执行。这防止了磁盘 I/O 或高强度 CPU 使用影响服务器的刻率(TPS)。
- 智能缓存(Caffeine): 频繁访问的数据(玩家统计数据、配置值)存储在高性能缓存中,以最大限度地减少数据库查询和文件读取。
- 分布式负载: 周期性任务将其操作均匀分布在 1 秒内的 20 个刻中,防止在玩家数量较多时服务器出现突然的性能峰值。
性能概况(Spark 分析)
测试环境: Paper 1.19.4,1 名在线玩家,标准服务器负载。
// 服务器整体空闲率(越高越好)
Server thread: 100.00%
└── net.minecraft.server.MinecraftServer.waitUntilNextTick(): 85.37%
// 插件对主线程的总影响
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%
分析:
- 服务器花费超过 85% 的时间处于空闲状态,表明该插件不会对服务器整体健康产生负面影响。
- 所有插件组件对主线程的总影响仅为**~0.24%**。这是一个在统计上可忽略不计的值,证实即使在最繁忙的服务器上,它也不会对 TPS 造成明显影响。
? 集成与安装
集成支持:
- WorldGuard: 允许为特定区域(竞技场、市场、挂机室等)定义完全不同的挂机时长和惩罚措施。(可选)
- PlaceholderAPI: 与其他插件共享动态数据,如
%antiafk_tag%、%antiafk_reason%。(可选) - ProtocolLib: 为 GUI 中的文本输入等功能提供更高级的用户体验。(可选)
安装步骤:
- 在此处下载最新版本 here。
- 将
.jar文件放入服务器的plugins文件夹中。 - 启动服务器以生成默认配置文件(
config.yml、messages.yml、questions.yml、playerdata.db)。 - 根据需要自定义配置文件,并使用
/antiafk reload命令。
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
下载 AntiAFK - 性能 AFK 解决方案
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AntiAFK - 性能 AFK 解决方案
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AntiAFK - 性能 AFK 解决方案
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AntiAFK - 性能 AFK 解决方案
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AntiAFK - 性能 AFK 解决方案
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AntiAFK - 性能 AFK 解决方案
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AntiAFK - 性能 AFK 解决方案
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AntiAFK - 性能 AFK 解决方案
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AntiAFK - 性能 AFK 解决方案
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AntiAFK - 性能 AFK 解决方案
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
? 未分类
- feat: 添加 StressCommand 以模拟玩家负载并增强 Learni…
- PR: #14
- feat: 实现限制分析以检测 AFK 池及类似情况 …
- PR: #15
- test: 为行为分析和玩家行为数据添加单元测试
- PR: #16
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
使床在所有维度中爆炸的模组
插件
为 Armor Poser 模组添加兼容性
插件
SkyBlock、OneBlock、Boxed、SkyGrid、AcidIsland、CaveBlock、Poseidon、StrangerRealms——以及更多!这些只是由 BentoBox 支持的基于岛屿的游戏模式之一。来自原版 ASkyBlock 的作者。
评论 0
登录后参与评分
还没有评论,来抢沙发吧