AfkGuard
Knows the difference between AFK and a macro
AfkGuard is a free AFK plugin for Paper and Spigot, from 1.17 to 26.x. It marks players as AFK after five minutes without real movement, catches movement macros that try to fake activity, and stops natural mob spawns in areas where only AFK players are standing.
How it works in play
- Going AFK:
/afkmarks you away, and/afk dinnertells the server why. Reasons come from a list you set inconfig.yml; free text is off unless you turn it on. - Automatic detection: a player who hasn't changed block or turned at least 5 degrees for five minutes is marked AFK. Mouse jitter and small packet noise don't reset the timer.
- Macros: when a player's position repeats in a short loop, like in a piston AFK pool, they're marked AFK straight away and told why.
- Coming back: moving, clicking, chatting or running a command clears the AFK status.
What you can turn on
- Longer timeouts by rank: five minutes by default, ten minutes with
afkguard.timeout.vipand twenty withafkguard.timeout.premium. You can add your own nodes and values; the highest match wins. - Auto-kick: off by default. When enabled, a player AFK for ten minutes is kicked, with warnings 60, 30 and 10 seconds before. Groups can have a longer threshold, or -1 so they're never kicked.
- AFK zone: off by default. AFK players are moved to a spot you set with
/afk setspawn, kept fed and invulnerable, and sent back when they move. - Mob cap: on by default. Natural spawns are cancelled unless an active player is within 128 blocks, so a crowd of AFK players at spawn doesn't use up the mob cap.
How to use it
- Install: drop the jar into
/pluginsand restart once. Detection and/afkwork straight away. English is the default; setlanguage: esfor Spanish. - Adjust the timeouts in
config.ymland give ranks the longer-timeout permissions. - Enable the extras you want: auto-kick, the AFK zone (then stand on the spot and run
/afk setspawn) or free-text reasons. - Apply changes with
/afk reload.
Commands and permissions
- Everyone (
afkguard.use):/afk [reason](alias/away) and/afk list. - Operators (
afkguard.admin):/afk info <player>,/afk setspawn,/afk reload. afkguard.bypass.detectionis never marked AFK automatically;afkguard.bypass.kickis never auto-kicked.afkguard.timeout.vip/.premiumandafkguard.kick.vip/.premiumset longer timeouts and kick thresholds.
Placeholders
With PlaceholderAPI installed: %afkguard_status%, %afkguard_reason%, %afkguard_time% and %afkguard_count%.
Requirements
- Paper or Spigot from 1.17 to 26.x, forks like Purpur included, on the Java version your server already uses.
- Optional: PlaceholderAPI. Without it the placeholders aren't registered and everything else works the same.
FAQ
Will it kick my players?
Not unless you enable auto-kick. It ships turned off.
Does reading chat count as AFK?
After five minutes without moving or looking around, yes. Typing in chat or running a command brings the player back. Give staff afkguard.bypass.detection if they should never be marked.
Can other plugins react when someone goes AFK?
Yes. The developer API tells your plugin when a player goes AFK and when they come back, with how long they were away.
Can I translate the messages?
Yes. English and Spanish are included in lang/, in MiniMessage, and missing keys fall back to English.
For questions or bug reports, use the discussion tab on this page or our Discord.