AFKStatus - 为服务器提供简单的离线检测
!\[\](\_49b50151-d6ab-43be-bb54-6c133719fb55.png)
AFKStatus 是一款轻量级的服务端模组,专为 Minecraft 设计,基于 NeoForge 和 Forge 加载器构建。它能自动追踪玩家活动,当玩家在可配置的时间内停止移动或聊天时,将其标记为 AFK(离开键盘)。玩家还可以通过简单的 /afk 命令手动切换 AFK 状态。
功能特性
自动 AFK 检测
通过追踪移动和聊天活动来检测不活跃状态。在可配置的超时时间后,玩家会被标记为 AFK 并广播该状态。
手动 AFK 切换
/afk 命令允许玩家手动设置或清除 AFK 状态。
自定义超时时间
可通过配置文件设置触发 AFK 的延迟以及可选的踢出超时时间。
可选的自动踢出
自动踢出超过设定时间仍处于 AFK 状态的玩家。
自定义消息与颜色
系统消息支持自定义,包括颜色选项。
记分板集成
使用 Minecraft 的队伍系统,通过 [AFK] 标签直观地标识 AFK 玩家。
仅服务端
无需安装客户端版本。只需将模组放入服务器的 mods/ 文件夹即可。

配置说明
首次启动服务器后,会在 config/ 目录下生成一个配置文件 (afkstatus-server.toml)。
afkTriggerTimer — 玩家被标记为 AFK 前的无活动时间(分钟)。
默认值:5
范围:1-60 分钟
afkKickTimer — 成为 AFK 后被踢出前的等待时间(分钟)。
默认值:0(已禁用)
范围:0-120 分钟
kickMessage — 玩家被踢出时显示的消息。
systemMessages — 是否广播 AFK 状态变更。
默认值:false
选项:true / false
checkIntervalTick — 检查 AFK 状态的频率。
(20 ticks = 1 秒)
默认值:20
范围:1-1200 ticks
messageColor — 消息颜色。
默认值:yellow
detection.enabled — 如果为 true,鼠标视角(相机旋转)将被视为活动。
默认值:false
detection.thresholdDegrees — 被视为活动的最小偏航角/俯仰角变化量。
默认值:5
范围:1-45 度
有效颜色:black, dark_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue, green, ¨C25C, ¨C26C, ¨C27C, ¨C28C, ¨C29C
bypassEnabled
在计算睡眠百分比时绕过 AFK 玩家
黑名单
AFKStatus 包含一个灵活的黑名单系统,用于将特定玩家排除在自动 AFK 踢出功能之外。这对于需要保持连接的服务端工作人员、受信任玩家或机器人非常有用,即使他们处于不活跃状态也不会被踢出。
- 存储方式: 黑名单条目以 JSON 文件的形式保存 (
afk_blacklist.json),位于 config/AFKStatus/ 目录内。
- 命令: 管理员可以使用游戏内的
/afk blacklist 子命令修改黑名单。
- 行为逻辑:
- 被列入黑名单的玩家仍会正常追踪 AFK 状态并进行标记。
- 无论配置的踢出超时时间是多少,被列入黑名单的玩家都不会因 AFK 而被踢出。
命令
/afk — 切换你的空闲状态。自动向其他玩家广播状态变更。
/afk help — 显示 AFKStatus 命令的帮助说明。
以下命令需要管理员权限
/afk blacklist add — 将玩家加入空闲黑名单。被拉入黑名单的玩家即使处于空闲状态也不会被自动踢出。
/afk blacklist remove — 从空闲黑名单中移除玩家。
/afk blacklist list — 列出当前所有在空闲黑名单中的玩家。
afk blacklist reload — 从磁盘重新加载黑名单,适用于手动编辑后使用。
此功能允许玩家在无需移动或聊天的情况下,手动表明自己处于空闲状态或返回在线状态。

AFKStatus - Simple AFK Detection for Servers
!\[\](\_49b50151-d6ab-43be-bb54-6c133719fb55.png)
AFKStatus is a lightweight, server-side mod for Minecraft, built on the NeoForge and Forge mod loader. It automatically tracks player activity and marks users as AFK (Away From Keyboard) when they stop moving or chatting for a configurable period. Players can also manually toggle AFK status using a simple /afk command.
Features
Automatic AFK detection
Detects inactivity by tracking movement and chat activity. Players are marked as AFK after a configurable timeout and broadcasted as such.
Manual AFK toggle
/afk command lets players manually set or clear AFK status.
Customizable timeouts
Set the AFK trigger delay and optional kick timeout via config.
Optional auto-kicking
Automatically kicks players who stay AFK beyond a set time.
Custom messages and colors
System messages are customizable, including color options.
Scoreboard integration
Uses Minecraft's team system to visually tag AFK players with [AFK].
Server-only
No client-side installation required. Just drop the mod into your server's mods/ folder.

Configuration
After the first server launch, a configuration file (afkstatus-server.toml) is created in your config/ directory.
afkTriggerTimer — Minutes of inactivity before a player is market afk.
Default: 5
Range: 1-60 minutes
afkKickTimer — Minutes after being AFK before being kicked.
Default: 0 (disabled)
Range: 0-120 minutes
kickMessage — Kick message that is shown to the player once he is kicked.
systemMessages — Whether to broadcast AFK status changes.
Default: false
Options: true / false
checkIntervalTick — How often to check AFK status.
(20 ticks = 1 second)
Default: 20
Range: 1-1200 ticks
messageColor — Messages color.
Default: yellow
detection.enabled — If true, mouse look (camera rotation) counts as activity.
Default: false
detection.thresholdDegrees — Minimum change in yaw/pitch required to count as activity.
Default: 5
Range: 1-45 degrees
Valid colors: black, dark_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue, green, ¨C25C, ¨C26C, ¨C27C, ¨C28C, ¨C29C
bypassEnabled
Bypasses afk players for sleep percentage
Blacklist
AFKStatus includes a flexible blacklist system to exclude specific players from the automatic AFK kick functionality. This is useful for server staff, trusted players, or bots that need to remain connected despite inactivity.
- Storage: Blacklist entries are saved as JSON file (
afk_blacklist.json) inside config/AFKStatus/ directory.
- Commands: Admins can change the blacklist in-game using
/afk blacklist subcommands.
- Behaviour:
- Blacklisted players are tracked for AFK status and tagged normally.
- Blacklisted players will not be kicked for being AFK, regardless of the configured kick timer.
Commands
/afk — Toggles your AFK status. Automatically broadcasts status changes to others.
/afk help— Shows the help instructions for AFKStatus commands.
Commands below require administrator permissions
/afk blacklist add — Adds a player to the AFK blacklist. Blacklisted players can go AFK but will not be kicked automatically.
/afk blacklist remove — Removes a player from the AFK blacklist.
/afk blacklist list — Lists all players currently on the AFK blacklist.
afk blacklist reload — Reloads blacklist from disk, useful if edited manually.
This lets players manually indicate they’re AFK or return without moving or chatting.

评论 0
登录后参与评分
还没有评论,来抢沙发吧