Somnus API (Discontinued)

A lightweight library for integrated sleep mechanics on Fabric.

This project is discontinued as of Fabric API 0.39.0+ for 1.16.5 and 1.17.1. Please use the EntitySleepEvents introduced in that Fabric API version instead.

Somnus is a lightweight library that adds a few events for sleeping in Minecraft to allow mod developers easy and compatible ways of implementing their sleep mechanics on Fabric.

BisectHosting

Features

  • Determining the time of day for the world when players wake up
  • Preventing or hooking into sleep attempts
  • Determining valid times of day for sleeping
  • Hooking into when players wake up
  • Changing vertical offsets for sleeping players

Adding to Your Project:

Please refer to the GitHub README file.

Support

Please report all bugs, issues, and feature requests to the issue tracker.

For non-technical support and questions, join the developer's Discord.

License

All source code and assets are licensed under LGPL 3.0.

Donations

Donations to the developer can be sent through Ko-fi.

The Somnus API (Discontinued) Team

profile avatar
  • 818
    Followers
  • 46
    Projects
  • 1.4B
    Downloads

More from TheIllusiveC4View all

  • Cherished Worlds project image

    Cherished Worlds

    • 71.4M
    • Mods

    Favorite/pin/bookmark certain worlds, which will always be at the top of the list and cannot be deleted.

    • 71.4M
    • April 29, 2026
    • Mods
  • Curios API (Forge/NeoForge) project image

    Curios API (Forge/NeoForge)

    • 276.7M
    • Mods

    A flexible and expandable accessory/equipment API for users and developers.

    • 276.7M
    • April 14, 2026
    • Mods
    • +2
  • Custom FoV project image

    Custom FoV

    • 1.9M
    • Mods

    Allows disabling or customizing field of view changes from sprinting, potions, archery, or underwater.

    • 1.9M
    • March 26, 2026
    • Mods
  • Comforts project image

    Comforts

    • 226.2M
    • Mods

    Adds sleeping bags and hammocks for, respectively, portability and turning day to night, without setting new spawns. Comes in 16 different colors!

    • 226.2M
    • March 7, 2026
    • Mods
    • +1
  • Cherished Worlds project image

    Cherished Worlds

    • 71.4M
    • Mods

    Favorite/pin/bookmark certain worlds, which will always be at the top of the list and cannot be deleted.

    • 71.4M
    • April 29, 2026
    • Mods
  • Curios API (Forge/NeoForge) project image

    Curios API (Forge/NeoForge)

    • 276.7M
    • Mods

    A flexible and expandable accessory/equipment API for users and developers.

    • 276.7M
    • April 14, 2026
    • Mods
    • +2
  • Custom FoV project image

    Custom FoV

    • 1.9M
    • Mods

    Allows disabling or customizing field of view changes from sprinting, potions, archery, or underwater.

    • 1.9M
    • March 26, 2026
    • Mods
  • Comforts project image

    Comforts

    • 226.2M
    • Mods

    Adds sleeping bags and hammocks for, respectively, portability and turning day to night, without setting new spawns. Comes in 16 different colors!

    • 226.2M
    • March 7, 2026
    • Mods
    • +1