Skip to content

DemonZ-Development/Onlysleep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Onlysleep Banner

๐ŸŒ™ Onlysleep

Skip the night with just one player sleeping โ€” or configure it your way.

Modrinth Hangar Spigot bStats Build CodeQL Java License

Supports: Bukkit ยท Spigot ยท Paper ยท Purpur ยท Folia ยท Any Paper fork


๐Ÿ’– Sponsored By

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

โœจ Features

  • One-Player Sleep โ€” Default mode lets a single player skip the night
  • Configurable Percentage โ€” Require any % of players to sleep (50%, 75%, 100%, etc.)
  • Per-World Sleep โ€” Configure per-world or global sleep counting
  • Multi-Platform โ€” Works on Bukkit, Spigot, Paper, Folia, and all derivatives
  • Weather Skip โ€” Automatically clear storms and thunderstorms
  • Visual Feedback โ€” Boss bar, action bar, progress bar, and title support
  • Sound Effects โ€” Configurable sounds when night is skipped
  • Smart Player Filtering โ€” Ignores AFK, spectators, exempt players, and more
  • AFK Detection โ€” Supports EssentialsX and CMI AFK status
  • PlaceholderAPI Support โ€” Over 10 placeholders for integrations
  • Update Checker โ€” Automatically checks for new versions
  • bStats Metrics โ€” Anonymous usage statistics
  • Disable Per World โ€” Disable sleep skipping in specific worlds

๐Ÿ“ฅ Installation

  1. Download the latest Onlysleep-*.jar from Modrinth, Hangar, or Spigot
  2. Place it in your server's plugins/ folder
  3. Restart your server (or reload with /reload โ€” though restart is recommended)
  4. Configure plugins/Onlysleep/config.yml to your liking
  5. Reload with /onlysleep reload

Requirements

  • Java 21+ (The plugin requires Java 21+ to run)
  • Minecraft 1.16.5+ (Bukkit, Spigot, Paper, Folia, or any compatible server)
  • No other plugins required! (Works standalone)
  • [Optional] PlaceholderAPI for placeholder expansion support

โš™๏ธ Configuration

Quick Start

The plugin works out-of-the-box with sensible defaults. Just drop it in and go!

Main Settings (config.yml)

Setting Default Description
sleep-percentage 50 % of players needed to sleep (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 storms when sleeping
manage-gamerule true Auto-manage playersSleepingPercentage gamerule

See the full config.yml for all options.

Messages (messages.yml)

All messages are fully customizable with color codes (&0-&f) and placeholders.


๐ŸŽฎ 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 command
onlysleep.info OP View plugin information
onlysleep.reload OP Reload configuration
onlysleep.status OP View plugin status
onlysleep.exempt None Excluded from sleep calculations (operators sleep by default)
onlysleep.update OP Receives update notifications

๐Ÿ“Š PlaceholderAPI

Onlysleep provides 12+ placeholders when PlaceholderAPI is installed.

Placeholder Description
%onlysleep_sleeping% Number of sleeping players in player's world
%onlysleep_required% Number of players needed to skip night
%onlysleep_percentage% Configured sleep percentage
%onlysleep_total% Total eligible player count in the world
%onlysleep_progress% Percentage of required sleepers achieved (0-100)
%onlysleep_progress_bar% Visual progress bar of sleep progress
%onlysleep_sleeping_names% Comma-separated names of sleeping players
%onlysleep_status% "Sleeping" or "Awake" for the player
%onlysleep_is_sleeping% true/false if player is sleeping
%onlysleep_is_night% true/false if it's night
%onlysleep_is_sleepable% true/false if it's night/storm in the world
%onlysleep_skipping% true/false if night is being skipped
%onlysleep_enabled% true/false if sleeping is enabled in player's 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 specific world
%onlysleep_world_required_<world>% Required count in specific world
%onlysleep_world_total_<world>% Total eligible in specific world

๐Ÿ—๏ธ Building from Source

Gradle (Recommended)

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

The compiled JAR will be in build/libs/.

Maven (Alternative)

git clone https://github.com/DemonZ-Development/Onlysleep.git
cd Onlysleep
mvn clean package

The compiled JAR will be in target/.


๐Ÿ”Œ API

Onlysleep provides a simple API for other plugins:

// Get the plugin instance
Onlysleep plugin = Onlysleep.getInstance();

// Get sleep manager
SleepManager sleepManager = plugin.getSleepManager();

// Check if a player is currently counted as sleeping
boolean sleeping = sleepManager.isPlayerSleeping(player);

// Get how many players are needed in a world
int required = sleepManager.getRequiredSleepingCount(world);

// Get how many are currently sleeping in a world
int sleeping = sleepManager.getSleepingCount(world);

// Check if a night skip is scheduled
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.

Live Statistics

bStats Servers


๐Ÿค Support & Links


โค๏ธ Credits

Developed by Demonz Development with love for the Minecraft community.


๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

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

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages