Compatibility
Minecraft: Java Edition
1.21.x
Platforms
Links
Tags
Creators
Details
Licensed MIT
Published 6 months ago
AntiAFK Plugin
A complete Anti-AFK plugin for Minecraft Paper 1.21.10 that automatically detects and kicks inactive players.
โจ Features
- ๐ฏ Automatic AFK Detection - Detects players who are inactive for too long
- โ ๏ธ Warning System - Warns players before they get kicked
- ๐ฎ Manual AFK Toggle - Players can mark themselves as AFK with
/afk - โ๏ธ Fully Configurable - Customize timeouts, messages and detection
- ๐ก๏ธ Permission System - Staff can bypass AFK detection
- ๐ข Broadcast Messages - Server is informed when players go AFK or return
๐ Requirements
- Minecraft: 1.21.10
- Server Software: Paper (or forks like Purpur)
- Java: 21 or higher
๐ฅ Installation
- Download the latest
AntiAFK-1.0.0.jarfrom releases - Place the JAR file in your server's
pluginsfolder - Restart your server
- Customize the configuration in
plugins/AntiAFK/config.yml - Use
/afkreloadto reload the configuration
โ๏ธ Configuration
The configuration is located in plugins/AntiAFK/config.yml:
# Time in seconds before a player is considered AFK
afk-timeout: 300
# Time in seconds before the warning is given
warning-time: 270
# Check interval in ticks (20 ticks = 1 second)
check-interval: 100
# Messages (use & for color codes)
messages:
kick: "&cYou have been kicked for inactivity!"
warning: "&eWarning: You will be kicked in {time} seconds for inactivity!"
afk-enabled: "&7You are now AFK"
afk-disabled: "&7You are no longer AFK"
player-afk: "&7{player} is now AFK"
player-back: "&7{player} is back"
reload: "&aConfiguration reloaded!"
no-permission: "&cYou don't have permission to do this!"
# Actions that reset AFK status
detect-movement: true
detect-chat: true
detect-block-break: true
detect-block-place: true
detect-interact: true
detect-damage: true
Configuration Options
| Option | Default | Description |
|---|---|---|
afk-timeout |
300 | Seconds before player gets kicked |
warning-time |
270 | Seconds before warning is given |
check-interval |
100 | Ticks between each check (20 = 1 sec) |
detect-movement |
true | Detect movement as activity |
detect-chat |
true | Detect chat as activity |
detect-block-break |
true | Detect block breaking as activity |
detect-block-place |
true | Detect block placing as activity |
detect-interact |
true | Detect interactions as activity |
detect-damage |
true | Detect damage as activity |
๐ฎ Commands
| Command | Description | Permission |
|---|---|---|
/afk |
Toggle your AFK status manually | antiafk.command |
/afkreload |
Reload the plugin configuration | antiafk.reload |
๐ Permissions
| Permission | Default | Description |
|---|---|---|
antiafk.command |
true | Use the /afk command |
antiafk.bypass |
op | Bypass AFK detection (for staff) |
antiafk.reload |
op | Reload the configuration |
Permission Examples
LuckPerms:
# Give moderators bypass permission
lp group moderator permission set antiafk.bypass true
# Give admins reload permission
lp group admin permission set antiafk.reload true
๐ How it Works
- Activity Tracking: The plugin tracks when players were last active
- Periodic Checks: Every X ticks (configurable) it checks if players have been inactive too long
- Warning: At
warning-timeseconds the player receives a warning - Kick: At
afk-timeoutseconds the player gets kicked - Broadcast: Other players are informed when someone goes AFK or returns
Detected Activities
The plugin detects the following activities (if enabled in config):
- โ Movement (position change, not just head rotation)
- โ Chat messages
- โ Breaking blocks
- โ Placing blocks
- โ Interactions (buttons, doors, etc.)
- โ Taking damage
- โ Executing commands
๐ Examples
Example 1: Default Usage
Player is inactive for 4 minutes
โ At 4:30 minutes: "โ ๏ธ Warning: You will be kicked in 30 seconds for inactivity!"
โ At 5:00 minutes: Player gets kicked
Example 2: Manual AFK
Player: /afk
โ "You are now AFK"
โ Server: "Player123 is now AFK"
Player moves
โ "You are no longer AFK"
โ Server: "Player123 is back"
Example 3: Staff Bypass
Staff with antiafk.bypass permission
โ Never gets kicked, regardless of inactivity
๐ Troubleshooting
Players are not getting kicked:
- Check if
afk-timeoutis set correctly - Verify players don't have
antiafk.bypasspermission - Verify the plugin is loaded correctly with
/plugins
Warnings don't work:
- Make sure
warning-timeis less thanafk-timeout - Check the console for errors
Config changes don't work:
- Use
/afkreloadafter editing the config - Or restart the server
๐ License
This project is open source and available for personal and commercial use.
Made with โค๏ธ for the Minecraft community


