AFK Sleep

AFK Sleep

Sleep while players are idle on your server · Works with custom player sleeping percentages · Handles dimensions, leaving, joining, ...

by
8.1K Downloads
datapackfabricforgeneoforgequiltgame-mechanicssocialutility
Rent Server with this Mod

Screenshots

A player sleeps while another player idles next to the bed

About this Mod

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

https://cdn.modrinth.com/data/hBJVFBHF/images/a555a85ba89158b0d992c7151b6d811a21493f16.jpeg

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.

Available Versions

Version 1.3.2release
MC 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8fabric, forge, neoforge, quilt
March 30, 2025
Version 1.3.2release
MC 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8datapack
December 23, 2024
Version 1.3.1release
MC 1.20.3, 1.20.4, 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3datapack
November 11, 2024
Version 1.3release
MC 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3datapack
November 11, 2024
Version 1.2.1release
MC 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3datapack
June 17, 2024

How to Install AFK Sleep on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set datapack Loader

In the panel under "Egg", select the datapack loader and matching Minecraft version (1.21.8).

3

Install Mod

Open the mod browser in the dashboard and search for "AFK Sleep". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

datapackfabricforgeneoforgequilt

Minecraft Versions

1.21.8, 1.21.7, 1.21.6 (+23 more)

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

AFK Sleep server crashes on startup – what to do?

Most common cause: wrong datapack version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.8). You can switch loaders with one click in the panel.

Is AFK Sleep compatible with datapack and fabric and forge and neoforge and quilt?

AFK Sleep officially supports datapack, fabric, forge, neoforge, quilt for Minecraft 1.21.8, 1.21.7, 1.21.6. Note: Forge and Fabric mods are NOT cross-compatible – pick one loader and stick with it. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with AFK Sleep – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if AFK Sleep consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install AFK Sleep with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Required

Supported Versions

1.21.81.21.71.21.61.21.51.21.41.21.31.21.21.21.11.211.20.6+16 more