Sleep

Sleep

Mod and data pack

Skip the night automatically when a configurable percentage or amount of players sleep! Displays sleeping players and offers various customizable features for smoother gameplay

Server AdventureGame MechanicsSocialUtility

49.3k downloads
74 followers
Follow Save
90% of ad revenue goes to creators. Go ad-free while supporting creators with Modrinth Plus. Subscribe today!

Sleep

Tip

Questions or issues? -> discord server | or create an issue on github

Suggestions and ideas to improve the datapack are welcome and the best support

Features

1. Sleeping players are displayed over the hotbar

2. Change how many players have to sleep to skip the night in the config

3. Use percentage instead of amount of players

4. Change if the night should be instantly skipped or just accelerated in the config

5. Change how long it should take to skip the night in the config

6. Set for yourself a notification for when you can sleep

7. Change how names should get displayed in the actionbar

8. Change to get heal when sleeping or not

9. Compatible with my AFK Announcer datapack/mod so players that are afk do not need to sleep to skip the night (you can change that with the config)

One player is sleeping

2 players are sleeping

Guides

Tip

If something doesn't work, feel free to join the discord server

How to Install a Datapack in Singleplayer
At the Creation of a World

How to install a datapack in singleplayer

  1. Open Minecraft
    Launch the game.

  2. Create a New World
    Navigate to "More" and click on "Data Packs".

    Minecraft Settings Image

  3. Add the Datapack
    Drag the datapack (a .zip file or directory) into the Minecraft window.

    • A confirmation screen will appear. Click "Yes".
  4. Activate the Datapack
    Move the datapack to the right-hand side of the screen by clicking the triangle on its icon (visible when hovering over it).

Minecraft Settings Image

  1. Complete World Creation
    • Click "Done" at the bottom of the screen.
    • Continue creating your world and click "Create New World".

⚠️ IMPORTANT ⚠️

The datapack only works if cheats are enabled.

You can verify the datapack is active by typing:
/datapack list enabled

This command should list an entry named [file/<your datapack file/directory name>].

In an Existing World

How to Install a Datapack in an Existing Singleplayer World

  1. Open Minecraft
    Launch the game.

  2. Select Your World

    • Choose the world you want to install the datapack for.
    • Click "Edit", then "Open World Folder".
  3. Add the Datapack

    • Open the folder named datapacks.
    • Place the datapack into this folder. It should be a .zip file or a directory.
  4. Reload the World

    • If you are in the world during installation, type /reload in the chat or press F3 + T to reload resources.
      (Make sure cheats are enabled.)

⚠️ IMPORTANT ⚠️

The datapack only works if cheats are enabled.

You can verify the datapack is active by typing:
/datapack list enabled

How to Enable Cheats Permanently After World Creation

If you encounter this issue, here is a step by step guide on how to enable Cheats/Admincommands permanently after you have already created a Minecraft world.

⚠️ Before you begin, you should save and backup your world in case something goes wrong.
(I will not take any responsibility for any corrupt worlds. Do this at your own risk!)
But don't worry this works without any problems.
If you don't want to change this permanently check out this guide.

1. You need NBTExplorer

NBTExplorer is an open-source NBT editor for all common sources of NBT data. It's mainly intended for editing Minecraft game data.

2. Open NBTExplorer and open your Minecraft world, where you want to enable Cheats/Admincommands.

NBTExplorer Image

3. Navigate to:

  • <Your Minecraft World>
  • level.dat
  • Data
  • allowCommands

NBTExplorer Navigation Image

4. Click on "Edit Tag Value"

Edit Tag Image

5. Change the Value from 0 to 1 and click "OK"

Change Value Image

6. Now click on "Save All Modified Tags"

Save Image

That's it. You are done. You can now join your world and check if you have permission to change your gamemode, for example.

How to Enable Cheats Temporarily After World Creation

Enabling Cheats Temporarily After World Creation

If you encounter this issue, here is a step-by-step guide on how to enable Cheats/Admin commands temporarily after you have already created a Minecraft world.

  1. Join Your World
    Open your single-player world and press "Escape".

  2. Open to LAN
    Click on "Open to LAN".

    Open to LAN Screenshot

  3. Allow Commands
    Set "Allow Commands" to ON.

    LAN World Minecraft Screen

  4. Start LAN World
    Click "Start LAN World" to apply the changes.

LAN World MC Screen

Now, you should be able to use commands like changing your gamemode. Keep in mind that this is only temporary and will need to be done every time you join the world.

How to Install a Datapack in Multiplayer

How to Install a Datapack in Multiplayer

  1. Open Your Server Folder
    Navigate to your server folder, then open the folder for the world you wish to install the datapack in (default: world).

  2. Add the Datapack

    • The datapack should be a .zip file.
    • Place the datapack into a folder named datapacks inside the world folder.
  3. Reload the Server

    • Type /reload from the console or as a level 3 operator if the server was running during the installation.
How to Uninstall a Datapack

How to Uninstall a Datapack from Your Singleplayer World or Server

  1. Run the Uninstall Command
    For my datapacks, run the command:
    /function datapack_name:uninstall

  2. Delete the Datapack

    • Delete the datapack from the folder you placed it in.
    • Alternatively, you can run:
      /datapack disable [file/your data pack file/directory name]
  3. Reload the World or Server
    After deleting or disabling the datapack, run:
    /reload

How to Install a Mod on a Minecraft Server

Step-by-Step Guide to Installing a Mod on a Minecraft Server

  1. Download the Mod

    • Make sure to download the correct version of the Mod that matches your server's Minecraft version.
    • Important: The mod file should be a .jar file.
  2. Ensure No Datapacks or Other Mods Conflict

    • Do not have both a datapack and a mod installed at the same time, as they may conflict.
    • Only install one or the other, depending on your server's setup.
  3. Locate the Mods Folder

    • Open your server's root directory.
    • Inside this directory, find the folder named mods.
    • If the mods folder doesn't exist, create one.
  4. Install the Mod

    • Paste the downloaded .jar file for the Mod into the mods folder.
  5. Restart the Server

    • After adding the Mod to the mods folder, restart your Minecraft server for the mod to be activated.
  6. Verify Mod Installation

    • Once the server has restarted, join the server and check if the Mod is working.
    • You can use /mods or a similar command (depending on the mod) to see if the Mod has been successfully loaded.

Additional Tips

  • Backup Your Server: Always create a backup before installing the Mod to avoid data loss in case something goes wrong.
  • Ensure Mod Compatibility: Check that the Mod is compatible with your Minecraft server version and any other mods you have installed.

Config

Config update coming soon

To enable a notification that notifies you when you can go to bed use:

/trigger sleep_notification set value

value = 0 = disabled --> default value

value = 1 = chat notification

value = 2 = sound notification

value = 3 = chat & sound notification

edit the volume of the notifcation with the voice/speech percentage in the music & sound options

You dont like the sound? tell me on my discord server

Who can do this? --> Everyone (only players who have enabled this will get a message or sound)

To change how many players have to sleep to skip the night do:

/scoreboard players set &amount_to_sleep sleep.config your_value

your_value = amount of players that have to sleep | 1 = default value

If there are less players than your set value online, only 1 player has to sleep

Who can change that? --> Only server operators

If you want to use percentage instead of amount of players

/scoreboard players set &percentage_mode sleep.config value

value = 0 = off (amount of players is used) --> default

value = 1 = on (percentage of players is used)

Who can change that? --> Only server operators

To change the percentage of players that have to sleep

/scoreboard players set &percentage_to_sleep sleep.config value

value = percentage of players that have to sleep

default value = 50 (so 50% of the players have to sleep)

Who can change that? --> Only server operators

To change between instant night skip and time warp do: --> 1.21+ only

/scoreboard players set &time_control sleep.config value

value = 0 = instant night skip --> default value

value = 1 = time warp

Who can change that? --> Only server operators

To change how long it should take to skip a night do:

/scoreboard players set &time_until_skip sleep.config value

value = 1 = 2 seconds

value = 2 = 5 seconds --> default value

value = 3 = 10 seconds

For 1.21+ only value = any value in seconds

Who can change that? --> Only server operators

To change if afk players should count to the players that need to sleep do: --> 1.21+ only

/scoreboard players set &afk_players_sleep sleep.config value

value = 0 = off --> default value

value = 1 = on

Who can change that? --> Only server operators

To change how names get displayed in the actionbar --> 1.21+ only

/scoreboard &actionbar_display sleep.config set value

value = 0 = disabled ​​​​​​​

value = 1 = Only names --> default

value = 2 = @s selector (e.g. prefix will be shown)

Who can change that? --> Only server operators

Change to get heal when sleeping --> 1.21+ only

/scoreboard players set &heal_when_sleeping sleep.config value

value = 0 = disabled --> default

value = 1 = Slow regeneration​​​​​​​

value = 2 = Instant full health

Who can change that? --> Only server operators


Project members

Jodek

Owner

Mqx

Member

Details

Licensed MIT
Published 9 months ago
Updated 21 days ago