HomeJavaModsAnti AFK System
Anti AFK System

AntiAFK Plugin

A complete Anti-AFK plugin for Minecraft Paper 1.21.10 that automatically detects and kicks inactive players.

✨ Features

📋 Requirements

📥 Installation

  1. Download the latest AntiAFK-1.0.0.jar from releases
  2. Place the JAR file in your server's plugins folder
  3. Restart your server
  4. Customize the configuration in plugins/AntiAFK/config.yml
  5. Use /afkreload to 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

  1. Activity Tracking: The plugin tracks when players were last active
  2. Periodic Checks: Every X ticks (configurable) it checks if players have been inactive too long
  3. Warning: At warning-time seconds the player receives a warning
  4. Kick: At afk-timeout seconds the player gets kicked
  5. Broadcast: Other players are informed when someone goes AFK or returns

Detected Activities

The plugin detects the following activities (if enabled in config):

📝 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:

Warnings don't work:

Config changes don't work:

📄 License

This project is open source and available for personal and commercial use.


Made with ❤️ for the Minecraft community

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more