
Modrinth · Minecraft mod
Detect AFK Players
AFK/idle detection that's extremely performant · Players go AFK after 3 minutes (configurable) without moving their mouse · Extend with plenty of add-ons!
Quick answer
Which Detect AFK Players release should I use?
Detect AFK Players 1.2.2+mod targets 1.18, 1.18.1, 1.18.2 with Fabric, Forge, NeoForge. Installation on the client is optional. Installation on the dedicated server is optional. No extra mods listed for this file.
Where it goes
Is Detect AFK Players required on the client, server, or both?
Installation on the client is optional. Installation on the dedicated server is optional.
The source marks this as usable on both the client and server.
What else does Detect AFK Players 1.2.2+mod need?
1.2.2+mod. Change the file and its required mods may change too.
This file does not list any required mods. Do not add a library just because a different file uses it.
This file does not list any required or optional mods.
Before you install it
Add Detect AFK Players without breaking your instance.
Built for Detect AFK Players 1.2.2+mod. Pick another file and the loader, install side or required mods may change.
- 01
Stick to this file
Use 1.2.2+mod. It targets 1.18, 1.18.1, 1.18.2 with Fabric, Forge, NeoForge; another release may have different loader, side or dependency requirements.
- 02
Bring the mods it needs
This file does not list any required mods. Do not add a library just because a different file uses it.
- 03
Put it on the correct side
Installation on the client is optional. Installation on the dedicated server is optional.
- 04
Pick the file you checked
Use the “Get this file” button beside 1.2.2+mod. It opens that exact file at the source.
About this project
What does Detect AFK Players add?
Detect AFK Players
Detects player inactivity based on head rotation - simple, accurate, and fast. Intended as a dependency for datapacks and server operators.
This doesn't do much without add-ons (better performance), so you'll probably want to download one of those too.
Add-ons
- Pause Day Cycle - Pauses time when all players are AFK
- AFK Sleep - Allows sleeping when players are AFK, and handles dimensions + updates correctly unlike alternatives
- AFK Dim Names - Player names are dimmed when AFK
- AFK Message - Chat notifications for player status
- AFK Sit - Players sit down when they're AFK
Core Functionality
- Tags players as
afkafter 3 minutes - Detection based on head rotation, more accurate than position
- Significantly better performance than alternatives
- Modular (see above for add-ons)
To configure how long it takes to become AFK, use the command below.
By default, this is set to 3600 (which is 3 minutes).
/scoreboard players set .threshold afk.settings NUMBER_OF_TICKS
To enable players using /trigger afk, use the following command. No players are allowed to become AFK manually unless enabled by an admin.
/scoreboard players enable PLAYER afk
Performance
Common AFK detection methods check X/Y/Z, inventory changes, and block interactions - often on every tick. Instead, this data pack does a single head rotation NBT check per player every 1.5 seconds, resulting in a significantly less computation as compared to alternatives, sometimes by up to two orders of magnitude.
The head rotation method also eliminates false triggers from entity interactions (players attacking, explosions, etc) and anti-AFK automations such as water streams.
API
Two function tags are provided:
afk:away- Executed as player on AFKafk:back- Executed as player on return
Additional documentation is provided on GitHub, such as all the stable scoreboard objectives and how to use them.
Example implementation:
kick-afk-players/data/afk/tags/functions/away.json
{ "values": ["afk_kick:kick"] }
kick-afk-players/data/afk_kick/functions/kick.mcfunction
kick @s AFK
Project description from Modrinth.
Pick your setup
Detect AFK Players by Minecraft version and loader
Choose the version and loader you play, then open the matching release.
1.21.7
5 loader builds1.21.6
5 loader builds1.21.5
5 loader builds1.21.4
5 loader builds1.21.3
5 loader builds1.21.2
5 loader builds1.21.1
5 loader builds1.21
5 loader builds1.20.6
5 loader builds1.20.5
5 loader builds1.20.4
5 loader buildsShowing the newest 12 of 24 game versions. Older files are in the list below.
Check the dependencies, then try the file in a copied instance before changing a world you care about.
Recent files
Detect AFK Players versions and loaders
1.2.2+mod
detect-afk-1.2.2.jar
26 Jul 2025
1.2.2
afk+v1.2.2+mc1.18-1.21.8.zip
26 Jul 2025
1.2.1+mod
detect-afk-1.2.1.jar
11 Apr 2025
1.2.1
afk+v1.2.1+mc1.20.3-1.21.5.zip
11 Apr 2025
1.2+mod
detect-afk-1.2.jar
30 Mar 2025
1.2
afk+v1.2.0+mc1.20.3-1.21.4.zip
11 Dec 2024
1.1.1
afk+1.1.1+mc1.18.x-1.21.0.zip
17 Jun 2024
1.1
afk+v1.1+mc1.13.x-1.20.x.zip
25 Feb 2024
1.0.0
afk-1.0+1.20.zip
2 Aug 2023
Looking for an older file? The official Modrinth project page is in Resources.