▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/Anti AFK System
Anti AFK System

Anti AFK System

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

65
3

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

  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

OptionDefaultDescription
afk-timeout300Seconds before player gets kicked
warning-time270Seconds before warning is given
check-interval100Ticks between each check (20 = 1 sec)
detect-movementtrueDetect movement as activity
detect-chattrueDetect chat as activity
detect-block-breaktrueDetect block breaking as activity
detect-block-placetrueDetect block placing as activity
detect-interacttrueDetect interactions as activity
detect-damagetrueDetect damage as activity

🎮 Commands

CommandDescriptionPermission
/afkToggle your AFK status manuallyantiafk.command
/afkreloadReload the plugin configurationantiafk.reload

🔐 Permissions

PermissionDefaultDescription
antiafk.commandtrueUse the /afk command
antiafk.bypassopBypass AFK detection (for staff)
antiafk.reloadopReload 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):

  • ✅ 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-timeout is set correctly
  • Verify players don't have antiafk.bypass permission
  • Verify the plugin is loaded correctly with /plugins

Warnings don't work:

  • Make sure warning-time is less than afk-timeout
  • Check the console for errors

Config changes don't work:

  • Use /afkreload after 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

Совместимость

Minecraft: Java Edition

1.21.x

Платформы

Поддерживаемые окружения

Сервер

Создатели

Детали

Лицензия:MIT
Опубликован:2 месяца назад
Обновлён:2 месяца назад
Главная