AFK Actions
一款功能强大且丰富的 Paper/Purpur 服务器 AFK(挂机)检测插件,通过可自定义的命令和多语言支持自动管理空闲玩家。
? 特性
- ? 自动 AFK 检测 - 追踪玩家移动和聊天活动
- ⚙️ 双命令系统 - 当玩家进入或退出 AFK 状态时执行相应命令
- ? 多语言支持 - 内置英语和土耳其语翻译(完全可定制)
- ?️ 智能豁免 - OP 和基于权限的 AFK 免疫机制
- ? 广播系统 - 向全服通知 AFK 状态变更
- ? 调试模式 - 详细的日志记录以便故障排除
- ? 管理命令 - 查看、列出和重置玩家的 AFK 状态
- ⚡ 高性能 - 轻量级,对服务器影响极小
- ? 完全可定制 - 每条消息和设置均可配置
? 要求
- Minecraft: 1.21+
- 服务器: Paper, Purpur 或任何基于 Paper 的服务器
- Java: 21+
? 命令
所有命令均位于主命令 /afkactions 下(别名:/afk)
| 命令 |
权限 |
描述 |
/afkactions |
- |
显示帮助菜单 |
/afkactions help |
- |
显示可用命令 |
/afkactions reload |
afkactions.reload |
重新加载配置文件和语言文件 |
/afkactions status <player> |
afkactions.status |
查看玩家的详细 AFK 状态 |
/afkactions list |
afkactions.list |
列出当前所有处于 AFK 状态的玩家 |
/afkactions reset <player> |
afkactions.reset |
重置玩家的 AFK 状态 |
? 权限
管理员权限
| 权限 |
默认值 |
描述 |
afkactions.* |
op |
授予所有 AFK Actions 权限 |
afkactions.reload |
op |
重新加载插件配置 |
afkactions.status |
op |
查看玩家 AFK 状态 |
afkactions.list |
op |
列出所有 AFK 玩家 |
afkactions.reset |
op |
重置玩家 AFK 状态 |
豁免权限
| 权限 |
默认值 |
描述 |
afkactions.bypass |
false |
使玩家免受 AFK 系统影响 - 永远不会被标记为 AFK |
⚙️ 配置
主配置文件 (config.yml)
# AFK Actions Plugin Configuration
# 所有时间单位均为秒
# 语言 (en = 英语, tr = 土耳其语)
language: "en"
# 调试模式 - 在控制台中显示详细日志 (默认: false)
debug: false
# AFK 检测时间 - 玩家在无活动后经过此时间将被标记为 AFK (秒)
afk-detection-time: 180
# 命令执行时间 - 玩家处于 AFK 状态超过此时间后将执行命令 (秒)
command-execution-time: 600
# 豁免设置
exemptions:
# OP 是否应免除 AFK 系统?
ignore-ops: true
# 拥有 afkactions.bypass 权限的玩家自动获得豁免
# 广播设置
broadcast:
# 是否向服务器广播 AFK 状态?
afk-enabled: true
# 是否向服务器广播从 AFK 返回的状态?
return-enabled: true
# 当玩家变为 AFK 时执行的命令
# 以玩家身份运行的命令 (不要包含 /)
# 可用占位符: {player}
player-commands:
- "server lobby"
# 从控制台运行的命令 (不要包含 /)
# 可用占位符: {player}
console-commands:
- "kick {player} You have been AFK for too long!"
# 当玩家从 AFK 返回时执行的命令
# 以玩家身份运行的命令 (不要包含 /)
# 可用占位符: {player}
return-player-commands:
- "spawn"
# 从控制台运行的命令 (不要包含 /)
# 可用占位符: {player}
return-console-commands:
- "tell {player} Welcome back!"
- "effect give {player} minecraft:speed 10 1"
? 语言文件
插件会在 plugins/AFKActions/ 中创建可定制的语言文件:
英语 (messages_en.yml)
土耳其语 (messages_tr.yml)
所有消息(包括广播、命令和错误信息)均可完全翻译!
更改语言:
language: "en" # 或 "tr"
然后运行:/afkactions reload
? 工作原理
AFK 检测流程
- 玩家闲置 → 在配置的时间内没有移动或聊天
- AFK 状态 → 玩家被标记为 AFK(默认 3 分钟)
- 广播 → 服务器收到通知:
{player} is now AFK!(如果启用)
- 等待期 → 在命令执行之前的额外等待时间
- 命令执行 → 总时间过后(默认 10 分钟),执行命令
- 玩家返回 → 发生移动/聊天时,清除 AFK 状态
- 返回广播 → 服务器收到通知:
{player} is no longer AFK!(如果启用)
- 返回命令 → 可选命令在返回时立即执行
? 用例与示例
示例 1:踢出 AFK 玩家
afk-detection-time: 300 # 5 分钟
command-execution-time: 600 # 总共 10 分钟
player-commands: []
console-commands:
- "kick {player} You were AFK for too long!"
示例 2:移至大厅
player-commands:
- "server lobby"
console-commands:
- "tell {player} Moving you to lobby due to inactivity"
示例 3:旁观者模式 + 返回系统
# 当处于 AFK 状态时
console-commands:
- "gamemode spectator {player}"
- "tell {player} You are now in spectator mode (AFK)"
# 当返回时
return-console-commands:
- "gamemode survival {player}"
- "effect give {player} minecraft:regeneration 30 2"
- "tell {player} Welcome back! Restored to survival mode"
示例 4:经济/奖励系统
# 当从 AFK 返回时
return-console-commands:
- "eco give {player} 100"
- "title {player} title {\"text\":\"Welcome Back!\",\"color\":\"gold\"}"
- "title {player} subtitle {\"text\":\"Here's $100!\",\"color\":\"yellow\"}"
?️ 豁免
OP 豁免(基于配置)
exemptions:
ignore-ops: true # OP 永远不会进入 AFK 状态
基于权限的豁免
授予 afkactions.bypass 权限以豁免特定玩家:
LuckPerms 示例:
# 豁免单个玩家
/lp user PlayerName permission set afkactions.bypass true
# 豁免 VIP 组
/lp group vip permission set afkactions.bypass true
# 豁免工作人员
/lp group admin permission set afkactions.bypass true
/lp group moderator permission set afkactions.bypass true
? 调试模式
启用调试模式以获取详细日志:
debug: true
控制台输出:
[AFKActions] [DEBUG] Executing 1 AFK player command(s) for PlayerName
[AFKActions] [DEBUG] AFK player command: server lobby
[AFKActions] [DEBUG] Executing 1 return console command(s) for PlayerName
[AFKActions] [DEBUG] Return console command: tell PlayerName Welcome back!
非常适合排查命令执行问题!
? 占位符
当前支持的占位符:
适用于所有命令列表(玩家/控制台,闲置/返回)
? 状态命令详情
/afkactions status <player> 显示:
- ✅ 玩家名称
- ? 闲置状态(AFK / Active)
- ⏰ 距离上次活动的时间
- ⚙️ 已执行命令的状态
- ⏳ 直到命令执行剩余的等待时间(如果处于闲置状态)
非常适合管理员检查玩家活跃度!
? 自定义技巧
自定义消息
编辑 plugins/AFKActions/ 中的语言文件:
messages_en.yml - 英文消息
messages_tr.yml - 土耳其语消息
所有颜色均使用 & 代码:&a = 绿色,&c = 红色,&e = 黄色,等等。
多条命令
您可以为每个操作添加多条命令:
console-commands:
- "tell {player} You are AFK!"
- "title {player} title {\"text\":\"AFK\",\"color\":\"red\"}"
- "gamemode spectator {player}"
- "tp {player} 0 100 0"
BungeeCord/Velocity 支持
对于网络服务器,请使用控制台命令:
BungeeCord:
console-commands:
- "send {player} lobby"
Velocity:
console-commands:
- "server {player} lobby"
? 性能
- ✅ 轻量级 - 每秒运行一次检测,CPU 占用极低
- ✅ 并发 HashMaps - 线程安全的玩家追踪
- ✅ 高效的调度 - 使用 Bukkit 的任务系统
- ✅ 无需数据库 - 所有数据存储在内存中
- ✅ 自动清理 - 玩家断开连接时移除玩家数据
? 安装
- 下载最新版本
- 将 JAR 文件放入服务器的
plugins 文件夹
- 重启或重载服务器
- 配置
plugins/AFKActions/config.yml
- 可选:自定义语言文件
- 运行
/afkactions reload 应用更改
? 许可证
本插件可免费使用和修改。
⭐ 鸣谢
开发者: DevPanda (Efe Dönmez)
API: Paper 1.21+
编程语言: Kotlin
用 ❤️ 为 Minecraft 社区制作
AFK Actions
A powerful and feature-rich AFK detection plugin for Paper/Purpur servers that automatically manages idle players with customizable commands and multi-language support.
? Features
- ? Automatic AFK Detection - Tracks player movement and chat activity
- ⚙️ Dual Command System - Execute commands when players go AFK and when they return
- ? Multi-Language Support - Built-in English and Turkish translations (fully customizable)
- ?️ Smart Exemptions - OP and permission-based AFK immunity
- ? Broadcast System - Server-wide notifications for AFK status changes
- ? Debug Mode - Detailed logging for troubleshooting
- ? Management Commands - View, list, and reset player AFK status
- ⚡ High Performance - Lightweight with minimal server impact
- ? Fully Customizable - Every message and setting is configurable
? Requirements
- Minecraft: 1.21+
- Server: Paper, Purpur, or any Paper-based server
- Java: 21+
? Commands
All commands are under the main /afkactions command (alias: /afk)
| Command |
Permission |
Description |
/afkactions |
- |
Show help menu |
/afkactions help |
- |
Show available commands |
/afkactions reload |
afkactions.reload |
Reload configuration and language files |
/afkactions status <player> |
afkactions.status |
View detailed AFK status of a player |
/afkactions list |
afkactions.list |
List all currently AFK players |
/afkactions reset <player> |
afkactions.reset |
Reset a player's AFK status |
? Permissions
Admin Permissions
| Permission |
Default |
Description |
afkactions.* |
op |
Grants all AFK Actions permissions |
afkactions.reload |
op |
Reload plugin configuration |
afkactions.status |
op |
View player AFK status |
afkactions.list |
op |
List all AFK players |
afkactions.reset |
op |
Reset player AFK status |
Exemption Permission
| Permission |
Default |
Description |
afkactions.bypass |
false |
Exempts player from AFK system - Never marked as AFK |
⚙️ Configuration
Main Config (config.yml)
# AFK Actions Plugin Configuration
# All times are in seconds
# Language (en = English, tr = Turkish)
language: "en"
# Debug mode - Shows detailed logs in console (default: false)
debug: false
# AFK detection time - Player will be marked as AFK after this time of inactivity (seconds)
afk-detection-time: 180
# Command execution time - Commands will run after player has been AFK for this long (seconds)
command-execution-time: 600
# Exemption settings
exemptions:
# Should OPs be exempt from the AFK system?
ignore-ops: true
# Players with afkactions.bypass permission are automatically exempt
# Broadcast settings
broadcast:
# Should AFK status be broadcast to the server?
afk-enabled: true
# Should return from AFK be broadcast to the server?
return-enabled: true
# Commands to run when player becomes AFK
# Commands to run as the player (do not include /)
# Available placeholder: {player}
player-commands:
- "server lobby"
# Commands to run from console (do not include /)
# Available placeholder: {player}
console-commands:
- "kick {player} You have been AFK for too long!"
# Commands to run when player returns from AFK
# Commands to run as the player (do not include /)
# Available placeholder: {player}
return-player-commands:
- "spawn"
# Commands to run from console (do not include /)
# Available placeholder: {player}
return-console-commands:
- "tell {player} Welcome back!"
- "effect give {player} minecraft:speed 10 1"
? Language Files
The plugin creates customizable language files in plugins/AFKActions/:
English (messages_en.yml)
Turkish (messages_tr.yml)
All messages including broadcasts, commands, and errors are fully translatable!
Change language:
language: "en" # or "tr"
Then run: /afkactions reload
? How It Works
AFK Detection Flow
- Player goes idle → No movement or chat for configured time
- AFK Status → Player is marked as AFK (3 minutes default)
- Broadcast → Server notified:
{player} is now AFK! (if enabled)
- Wait Period → Additional waiting time before commands execute
- Command Execution → After total time (10 minutes default), commands run
- Player Returns → On movement/chat, AFK status clears
- Return Broadcast → Server notified:
{player} is no longer AFK! (if enabled)
- Return Commands → Optional commands execute immediately upon return
? Use Cases & Examples
Example 1: Kick AFK Players
afk-detection-time: 300 # 5 minutes
command-execution-time: 600 # 10 minutes total
player-commands: []
console-commands:
- "kick {player} You were AFK for too long!"
Example 2: Move to Lobby
player-commands:
- "server lobby"
console-commands:
- "tell {player} Moving you to lobby due to inactivity"
Example 3: Spectator Mode + Return System
# When AFK
console-commands:
- "gamemode spectator {player}"
- "tell {player} You are now in spectator mode (AFK)"
# When returning
return-console-commands:
- "gamemode survival {player}"
- "effect give {player} minecraft:regeneration 30 2"
- "tell {player} Welcome back! Restored to survival mode"
Example 4: Economy/Reward System
# When returning from AFK
return-console-commands:
- "eco give {player} 100"
- "title {player} title {\"text\":\"Welcome Back!\",\"color\":\"gold\"}"
- "title {player} subtitle {\"text\":\"Here's $100!\",\"color\":\"yellow\"}"
?️ Exemptions
OP Exemption (Config-based)
exemptions:
ignore-ops: true # OPs never go AFK
Permission-based Exemption
Grant afkactions.bypass permission to exempt specific players:
LuckPerms Examples:
# Exempt a single player
/lp user PlayerName permission set afkactions.bypass true
# Exempt VIP group
/lp group vip permission set afkactions.bypass true
# Exempt staff members
/lp group admin permission set afkactions.bypass true
/lp group moderator permission set afkactions.bypass true
? Debug Mode
Enable debug mode for detailed logging:
debug: true
Console Output:
[AFKActions] [DEBUG] Executing 1 AFK player command(s) for PlayerName
[AFKActions] [DEBUG] AFK player command: server lobby
[AFKActions] [DEBUG] Executing 1 return console command(s) for PlayerName
[AFKActions] [DEBUG] Return console command: tell PlayerName Welcome back!
Perfect for troubleshooting command execution!
? Placeholders
Currently supported placeholder:
{player} - The player's name
Works in all command lists (player/console, AFK/return)
? Status Command Details
/afkactions status <player> shows:
- ✅ Player name
- ? AFK status (AFK / Active)
- ⏰ Time since last activity
- ⚙️ Commands executed status
- ⏳ Time remaining until commands execute (if AFK)
Perfect for moderators to check player activity!
? Customization Tips
Custom Messages
Edit language files in plugins/AFKActions/:
messages_en.yml - English messages
messages_tr.yml - Turkish messages
All colors use & codes: &a = green, &c = red, &e = yellow, etc.
Multiple Commands
You can add multiple commands per action:
console-commands:
- "tell {player} You are AFK!"
- "title {player} title {\"text\":\"AFK\",\"color\":\"red\"}"
- "gamemode spectator {player}"
- "tp {player} 0 100 0"
BungeeCord/Velocity Support
For network servers, use console commands:
BungeeCord:
console-commands:
- "send {player} lobby"
Velocity:
console-commands:
- "server {player} lobby"
? Performance
- ✅ Lightweight - Checks run every second with minimal CPU usage
- ✅ Concurrent HashMaps - Thread-safe player tracking
- ✅ Efficient scheduling - Uses Bukkit's task system
- ✅ No database required - All data in memory
- ✅ Automatic cleanup - Player data removed on disconnect
? Installation
- Download the latest version
- Place JAR in your server's
plugins folder
- Restart or reload your server
- Configure
plugins/AFKActions/config.yml
- Optional: Customize language files
- Run
/afkactions reload to apply changes
? License
This plugin is free to use and modify.
⭐ Credits
Developer: DevPanda (Efe Dönmez)
API: Paper 1.21+
Language: Kotlin
Made with ❤️ for the Minecraft community
评论 0
登录后参与评分
还没有评论,来抢沙发吧