
Modrinth · Minecraft mod
AFK Sleep
Sleep while players are idle on your server · Works with custom player sleeping percentages · Handles dimensions, leaving, joining, ...
Quick answer
Which AFK Sleep release matches 1.21.2 Forge?
AFK Sleep 1.3.2+mod targets 1.21, 1.21.1, 1.21.2 with Fabric, Forge, NeoForge. Installation on the client is optional. Installation on the dedicated server is optional. All 1 required mods have matching files.
Where it goes
Is AFK Sleep 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 AFK Sleep 1.3.2+mod need?
1.3.2+mod on 1.21.2 Forge. Every mod below is checked against that same setup.
Install Detect AFK Players first. We found matching files for this game-version and loader setup.
We only count dependency files that match this setup. A file for another loader does not fill the gap.
Before you install it
Add AFK Sleep without breaking your instance.
Built for AFK Sleep 1.3.2+mod on 1.21.2 Forge. Pick another file and the loader, install side or required mods may change.
- 01
Stick to this file
Use 1.3.2+mod. It targets 1.21, 1.21.1, 1.21.2 with Fabric, Forge, NeoForge; another release may have different loader, side or dependency requirements.
- 02
Bring the mods it needs
Install Detect AFK Players first. We found matching files for this game-version and loader setup.
- 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.3.2+mod. It opens that exact file at the source.
About this project
What does AFK Sleep add?
AFK Sleep
Requires Detect AFK Players.
Allows players to sleep even when there are players AFK on the server, and respects your original playersSleepingPercentage. If you've got someone that joins then immediately leaves to take a shower, now that won't stop you from being able to skip the night.
Features
- Configurable percentage - Change the gamerule like you would normally
- Highly optimized - No commands run unless necessary, no NBT usage, no checks every tick
- Reacts to changes - Leaving, joining, changing AFK state, changing dimension, etc
- Works correctly - Other data packs don't consider dimensions or state changes

Details
When AFK Sleep is first installed, it uses the playersSleepingPercentage you've set as the percentage of non-AFK players in the overworld that have to be sleeping to skip the night. The table below explains it:
| Players | Not AFK | playersSleepingPercentage | Players required to sleep |
|---|---|---|---|
| 3 | 3 | 100% | 3 (all three players have to sleep) |
| 3 | 2 | 100% | 2 (only the two non-afk players have to sleep) |
| 3 | 2 | 50% | 1 (only half of the non-afk players have to sleep) |
To change the percentage of "active" players that need to sleep, just change the gamerule like you normally would, with /gamerule playersSleepingPercentage NUMBER. This gamerule is managed for you, so don't worry if it isn't set to the value you expect.
Before version 1.3: How to change playersSleepingPercentage
Because this datapack overrides the playersSleepingPercentage gamerule, you have to modify a scoreboard value to change its calculations. Replace the number '50' with the percentage you want to set.
/scoreboard players set .relativePercentage afk_sleep.dummy 50
If you want to uninstall the datapack, run /function afk_sleep:uninstall to delete the backing scoreboards and reset the playersSleepingPercentage automatically.
Project description from Modrinth.
Pick your setup
AFK Sleep by Minecraft version and loader
Choose the version and loader you play, then open the matching release.
1.21.8
5 loader builds1.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
1 loader build1.20.5
1 loader build1.20.4
1 loader buildShowing the newest 12 of 26 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
AFK Sleep versions and loaders
1.3.2+mod
afk-sleep-1.3.2.jar
30 Mar 2025
Looking for an older file? The official Modrinth project page is in Resources.