Skip to content

DemonZ-Development/Onlysleep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Onlysleep

Onlysleep

One player sleeps. Everyone wakes up.

Modrinth Hangar bStats Build License

Supports: Bukkit, Spigot, Paper, Purpur, Folia, and compatible forks (Minecraft 1.20.4–26.2, Java 21+; Paper 26.1+ requires Java 25)


What is Onlysleep?

A clean, lightweight sleep plugin that does one thing well: skip the night when a player goes to bed. No bloat, no wall of config you'll never touch. Just drop it in, and it works.

One player sleeping is the default. If you want a different threshold, say half the server or everyone, you can set that too. Weather clears alongside the night. The whole thing is per-world, so a player sleeping in world_nether won't skip the overworld.

Features

  • One-player sleep by default, or any percentage (0-100%)
  • Per-world sleep counting (each world tracks separately)
  • Weather skip: clear rain and thunder independently
  • Boss bar, action bar, progress bar, and title support
  • Configurable sounds when a player starts sleeping and when night is skipped
  • AFK detection (built-in tracker, plus EssentialsX and CMI)
  • Smart filtering: spectators, creative, flying, exempt permissions, disabled gamemodes
  • Automatic gamerule management for playersSleepingPercentage
  • PlaceholderAPI integration (12+ placeholders)
  • Update checker and bStats (anonymous, opt-out available)

Installation

  1. Download the latest Onlysleep-*.jar from Modrinth, Hangar, or GitHub Releases.
  2. Drop it into your server's plugins/ folder.
  3. Restart your server.
  4. Edit plugins/Onlysleep/config.yml to your liking.
  5. Apply changes with /onlysleep reload.

Requirements: Minecraft 1.20.4–26.2 and Java 21+. Paper 26.1+ requires Java 25. No other plugins needed. PlaceholderAPI is optional.

Configuration

The defaults work out of the box. Here are the main settings:

Setting Default Description
sleep-percentage 50 % of eligible players needed (0 = one player)
skip-delay-ticks 60 Delay before night skip (20 ticks = 1 second)
skip-type instant instant, speed, or gradual
per-world-sleep true Only count players in the same world
clear-weather true Clear rain when sleeping; thunder is configured separately
clear-thunder true Clear thunder independently of clear-weather
manage-gamerule true Temporarily override vanilla sleep math in enabled worlds

See the full config.yml for all options and messages.yml for message customization.

Commands

Command Description Permission
/onlysleep Show help onlysleep.command
/onlysleep help Show help page onlysleep.command
/onlysleep info Plugin information onlysleep.info
/onlysleep status Detailed status onlysleep.status
/onlysleep reload Reload configuration onlysleep.reload

Aliases: /os, /sleep

Permissions

Permission Default Description
onlysleep.* OP All permissions
onlysleep.command Everyone Use /onlysleep
onlysleep.info OP View plugin info
onlysleep.reload OP Reload config
onlysleep.status OP View status
onlysleep.exempt None Excluded from sleep calculations (operators sleep by default)
onlysleep.update OP Receives update notifications

PlaceholderAPI

When PlaceholderAPI is installed, you get these placeholders:

Placeholder Description
%onlysleep_sleeping% Sleeping players in the player's world
%onlysleep_required% Players needed to skip the night
%onlysleep_percentage% Configured sleep percentage
%onlysleep_total% Total eligible players in the world
%onlysleep_progress% % of required sleepers achieved (0-100)
%onlysleep_progress_bar% Visual progress bar
%onlysleep_sleeping_names% Comma-separated names of sleeping players
%onlysleep_status% "Sleeping" or "Awake"
%onlysleep_is_sleeping% true/false
%onlysleep_is_night% true/false if it's night
%onlysleep_is_sleepable% true/false if night/storm
%onlysleep_skipping% true/false if a skip is scheduled
%onlysleep_enabled% true/false if sleeping is enabled in the world
%onlysleep_afk% true/false if the player is AFK
%onlysleep_version% Plugin version
%onlysleep_platform% Server platform (Folia/Paper/Spigot/Bukkit)
%onlysleep_world_sleeping_<world>% Sleeping count in a specific world
%onlysleep_world_required_<world>% Required count in a specific world
%onlysleep_world_total_<world>% Total eligible in a specific world

Building

git clone https://github.com/DemonZ-Development/Onlysleep.git
cd Onlysleep
./gradlew clean build

The compiled JAR lands in build/libs/.

API

Onlysleep plugin = Onlysleep.getInstance();
SleepManager sleepManager = plugin.getSleepManager();

boolean sleeping = sleepManager.isPlayerSleeping(player);
int required = sleepManager.getRequiredSleepingCount(world);
int current  = sleepManager.getSleepingCount(world);
boolean skipping = sleepManager.isSkipScheduled(world);

bStats

This plugin uses bStats to collect anonymous usage statistics. No personal data is collected. You can opt out in plugins/bStats/config.yml.

bStats

Links


Sponsored By

Nexeu Sponsor
Looking for high-performance, budget-friendly game server hosting? Check out Nexeu Hosting!

License

MIT - see LICENSE.

About

πŸŒ™ Skip the night with just one player sleeping β€” or configure it your way.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages