Back to mods
AFK Sleep project artwork

Modrinth · Minecraft mod

AFK Sleep

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

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which AFK Sleep release matches 1.21.6 datapack?

Updated 1 year ago
Best match for your filters 1.3.2
Game version 1.21, 1.21.1, 1.21.2
Loader datapack

AFK Sleep 1.3.2 targets 1.21, 1.21.1, 1.21.2 with datapack. 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.

Client Optional
Dedicated server Optional
Loader for this release datapack
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source marks this as usable on both the client and server.

What else does AFK Sleep 1.3.2 need?

1.3.2 on 1.21.6 datapack. Every mod below is checked against that same setup.

All 1 required mods have matching files

Install Detect AFK Players first. We found matching files for this game-version and loader setup.

Detect AFK Players Needed by AFK Sleep 1.3.2
required
Matching file found Matched file: 1.2.2

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 on 1.21.6 datapack. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use 1.3.2. It targets 1.21, 1.21.1, 1.21.2 with datapack; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    Install Detect AFK Players first. We found matching files for this game-version and loader setup.

  3. 03

    Put it on the correct side

    Installation on the client is optional. Installation on the dedicated server is optional.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside 1.3.2. 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

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.

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.

62 available setups

Showing 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 of 8 releases match
Clear filters

Looking for an older file? The official Modrinth project page is in Resources.