All Mods Resource Packs Data Packs Shaders Modpacks Plugins
OnlySleep

OnlySleep

by Unknown • Downloads: 0 • Followers: 0
Description
Gallery
Changelog
Versions

Onlysleep

Onlysleep

One player sleeps. Everyone wakes up.

Onlysleep lets your server skip the night without waiting for every player to find a bed. One sleeper is enough by default, but you can require any percentage from 0 to 100. Install the JAR, restart the server, and the default configuration is ready to use.


Features

  • One-player sleep by default, with configurable percentage thresholds
  • Separate sleep counts for each world
  • Independent controls for clearing rain and thunder
  • Boss bar, action bar, title, and progress-bar feedback
  • Configurable sounds for bed entry and successful night skips
  • Built-in AFK tracking, plus EssentialsX and CMI support
  • Filters for spectators, creative players, flying players, game modes, and exempt permissions
  • Automatic handling of the playersSleepingPercentage gamerule
  • PlaceholderAPI support for sleep, world, and status data
  • Optional update checks and anonymous bStats metrics

Requirements: Minecraft 26.3 and Java 25 or newer. Onlysleep works on its own; PlaceholderAPI is optional.


Commands

Commands Preview

Aliases: /os, /sleep


Permissions

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

Configuration

You can use the defaults as-is. The main setting is sleep-percentage in config.yml:

  • 0 = one player sleeps, everyone wakes up
  • 50 = half the server needs to be in bed
  • 100 = everyone has to sleep

Set per-world-sleep: false if you want global counting across all worlds.

See config.yml for every option and messages.yml for message customization.


PlaceholderAPI

PlaceholderAPI Preview

If you have PlaceholderAPI installed, these placeholders are available:

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% 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 is in build/libs/.

bStats

bStats

Onlysleep uses bStats for anonymous usage metrics. You can opt out in plugins/bStats/config.yml.

Links


Sponsored By

Nexeu Sponsor

Server hosting for this project is sponsored by Nexeu Hosting.

How to Install OnlySleep (Plugin)

OnlySleep by Unknown is verified for Bukkit, Fabric, Folia, Paper, Purpur, Spigot across Minecraft versions 1.16, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.17, 1.17.1 (latest release: 1.4.4, file size: 118 KB). Follow the steps below to install it safely from ModCraft.tv:

  1. Click the Download button above and select your Minecraft version (1.16, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.17, 1.17.1) and platform (Bukkit, Fabric, Folia, Paper, Purpur, Spigot).
  2. Make sure you have the compatible loader or environment installed for Bukkit, Fabric, Folia, Paper, Purpur, Spigot.
  3. Move the downloaded OnlySleep file into your Minecraft .minecraft/plugins folder and launch the game.

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
26.3
Fabric
1mo ago 1
26.3 26.2 26.1.x +1
Bukkit Folia Paper Purpur Spigot
1mo ago 1
26.3
Fabric
2mo ago 1
26.3 26.2 26.1.x
Bukkit Folia Paper Purpur Spigot
2mo ago 1
26.3
Fabric
2mo ago 1
26.3 26.2 26.1.x
Bukkit Folia Paper Purpur Spigot
2mo ago 1
26.2
Fabric
3mo ago 1
26.2 26.1.x
Bukkit Folia Paper Purpur
3mo ago 1
26.2 26.1.x
Bukkit Folia Paper Purpur Spigot
3mo ago 1
26.2 26.1.x 1.21.x +1
Bukkit Folia Paper Purpur Spigot
5mo ago 1
26.1.x 1.21.x 1.20.x +4
Bukkit Folia Paper Purpur Spigot
6mo ago 1
26.1.x 1.21.x 1.20.x +4
Bukkit Folia Paper Purpur Spigot
6mo ago 1
26.1.x 1.21.x 1.20.x +4
Bukkit Folia Paper Purpur Spigot
6mo ago 1
[1.4.4] OnlySleep 1.4.4 by Unknown on Oct 18, 2026
Download
### Security
  • Fixed ReDoS-prone regular expressions in version and paste response parsing on Paper and Fabric
  • Replaced deprecated Bukkit APIs flagged by code scanning (getDescription, getDisplayName, sendTitle, Sound.valueOf, TextComponent.fromLegacyText, Spigot.sendMessage, World.get/setGameRuleValue) with Adventure and PluginMeta replacements
  • Removed dead code and made the Fabric TaskScheduler.Task holder static
  • Null-hardened Fabric /onlysleep world and /onlysleep gamemode command handlers

### Fixed
  • Fixed an inverted creative-mode check in Fabric SleepCounts that miscounted required sleepers
  • Fixed double percentage symbol appearing in /onlysleep status on Paper
  • Moved diagnostic dump paste uploads off the main server thread to run asynchronously
  • Replaced deprecated org.bukkit.ChatColor across Paper with a dedicated LegacyText helper to eliminate deprecation warnings while preserving formatting
  • Added support for underscores in raw Fabric configuration paths and improved percentage value parsing
  • Enforced Locale.ROOT across commands and configuration keys to prevent locale-specific casing bugs

### Changed
  • Refactored monolithic sleep managers on Paper and Fabric into dedicated lifecycle controllers (SkipCoordinator, GradualSkipController, SleepCounts, SleepEffects, SleepGamerules)
  • Split command handlers into dedicated action, dump, and config editor classes
  • Unified bed-leave and disconnect handling into a shared departure path on both platforms
  • Update checks now point at https://demonz.org/projects/onlysleep alongside Modrinth
  • Halloween countdown display is now colourised for both console and in-game chat
[1.4.4] OnlySleep 1.4.4 by Unknown on Oct 18, 2026
Download
### Security
  • Fixed ReDoS-prone regular expressions in version and paste response parsing on Paper and Fabric
  • Replaced deprecated Bukkit APIs flagged by code scanning (getDescription, getDisplayName, sendTitle, Sound.valueOf, TextComponent.fromLegacyText, Spigot.sendMessage, World.get/setGameRuleValue) with Adventure and PluginMeta replacements
  • Removed dead code and made the Fabric TaskScheduler.Task holder static
  • Null-hardened Fabric /onlysleep world and /onlysleep gamemode command handlers

### Fixed
  • Fixed an inverted creative-mode check in Fabric SleepCounts that miscounted required sleepers
  • Fixed double percentage symbol appearing in /onlysleep status on Paper
  • Moved diagnostic dump paste uploads off the main server thread to run asynchronously
  • Replaced deprecated org.bukkit.ChatColor across Paper with a dedicated LegacyText helper to eliminate deprecation warnings while preserving formatting
  • Added support for underscores in raw Fabric configuration paths and improved percentage value parsing
  • Enforced Locale.ROOT across commands and configuration keys to prevent locale-specific casing bugs

### Changed
  • Refactored monolithic sleep managers on Paper and Fabric into dedicated lifecycle controllers (SkipCoordinator, GradualSkipController, SleepCounts, SleepEffects, SleepGamerules)
  • Split command handlers into dedicated action, dump, and config editor classes
  • Unified bed-leave and disconnect handling into a shared departure path on both platforms
  • Update checks now point at https://demonz.org/projects/onlysleep alongside Modrinth
  • Halloween countdown display is now colourised for both console and in-game chat
[1.4.3] OnlySleep 1.4.3 by Unknown on Oct 04, 2026
Download
### Added
  • Added an Halloween Easter egg
[1.4.3] OnlySleep 1.4.3 by Unknown on Oct 04, 2026
Download
### Added
  • Added an Halloween Easter egg
[1.4.2] OnlySleep 1.4.2 by Unknown on Sep 20, 2026
Download

## [1.4.2] - 2026-09-20

### Changed
  • bumped dependencies for minecraft 26.3 (paper and fabric)
  • updated fabric clock manager call for 26.3 changes with fallback
  • updated fabric.mod.json and ci workflows for 26.3

### Fixed
  • suppressed removal warning for players_sleeping_percentage on paper 26.3

[1.4.2] OnlySleep 1.4.2 by Unknown on Sep 20, 2026
Download

## [1.4.2] - 2026-09-20

### Changed
  • bumped dependencies for minecraft 26.3 (paper and fabric)
  • updated fabric clock manager call for 26.3 changes with fallback
  • updated fabric.mod.json and ci workflows for 26.3

### Fixed
  • suppressed removal warning for players_sleeping_percentage on paper 26.3

[1.4.1] OnlySleep 1.4.1 by Unknown on Sep 04, 2026
Download
# initial fabric version
fixes some recent bugs..
## [1.4.0] - 2026-08-29

Latest-only 1.26.x - Java 25, Minecraft 26.2 (Paper & Fabric). Full parity + new APIs.

### Added

  • In-game config commands**: /onlysleep set <percentage|skiptype|perworld|skipdelay|morningtime|resettime|gradualspeed|clearweather|clearthunder|bossbar|actionbar|progressbar|title|sounds|managegamerule|afktime> <value> with persistence, /onlysleep get <key>, /onlysleep toggle <key>, /onlysleep world <enable|disable|list> [world], /onlysleep gamemode <enable|disable|list> [type] - all with tab-complete
  • Dump command**: /onlysleep dump [paste] - writes plugins/Onlysleep/dumps/dump-*.txt with config, worlds, eligible/sleeping/required, gamerules, players (AFK/exempt), messages; paste uploads to paste.mcsrv.top
  • Developer API**: api/OnlysleepAPI.java (setSleepPercentage, setSkipType, getRequiredSleepingCount, forceSkipNight, getDiscordMessage/stripColor for ZDiscord), api/events/NightSkipEvent/SleepStartEvent/SleepCancelEvent (cancellable, fabric/api/* parity)
  • Fabric parity**: sleep-percentage 0 default, setters, api/OnlysleepFabricAPI, same events, full command parity, FabricConfigManager persistence, PermissionHandler onlysleep.config/dump/world/gamemode
  • Discord helpers**: OnlysleepAPI.getSleepStartDiscordMessage / getEnoughSleepingDiscordMessage / getCancelledDiscordMessage for ZDiscord bridge

### Changed

  • Default to 1.26.x only**: build.gradle.kts paperApi 26.2-R0.1-SNAPSHOT / Java 25, plugin.yml api-version 1.21, fabric 26.2 / java >=25 / fabric-loader >=0.19.3, README 26.2, Java 25+, sleep-percentage 0 (was 50) for true one-player default
  • Help** now lists set/get/toggle/world/gamemode/dump with set options footer

### Fixed

  • Gradual mode not cancellable**: leaving bed during gradual/speed (activeTransitions) now cancels if sleeping < required - both Paper manager/SleepManager.java:206,230,469 and Fabric fabric/SleepManager.java:184,201,419 + timer check each tick
[1.3.0] OnlySleep 1.3.0 by Unknown on Jul 12, 2026
Download
> For the full changelog, visit the [Onlysleep Wiki](https://github.com/DemonZ-Development/Onlysleep/wiki/Changelog).


## [1.3.0] - 2026-07-12

This release makes advertised features work, hardens Folia thread safety, fixes gradual skipping, and closes reload and memory leaks.

### Added

  • Automatic gamerule management**: enabled worlds temporarily use playersSleepingPercentage: 101 so vanilla cannot race the plugin's configured sleep threshold. Each world's original value is restored when management stops, the world unloads, or the plugin disables.
  • World sleep sounds**: configurable sounds now play when a player enters a bed, when weather is cleared, and when the night skip completes.

### Changed

  • Version compatibility**: the release JAR now compiles against Paper 1.20.4 with Java 21 bytecode, while CI compiles and tests every available Paper API target through Paper 26.2 alpha.
  • Independent weather controls**: rain and thunder can now be cleared separately with clear-weather and clear-thunder.
  • Disabled gamemode filtering**: disabled gamemodes are excluded from both the sleeping count and the eligible-player total.

### Bug Fixes

  • Paper 26.1 startup crash**: gamerule management now uses the typed GameRule.PLAYERS_SLEEPING_PERCENTAGE API instead of the removed legacy string lookup.
  • Safe gamerule reloads**: turning off manage-gamerule or adding a world to disabled-worlds now restores the original gamerule immediately instead of leaving it at 101.
  • Dynamic world lifecycle**: worlds loaded after plugin startup receive the configured override, while unloading worlds are restored and removed from tracked state.
  • Boss bar no longer shows "Unknown" when the initiating sleeper logs off mid-skip**:
  • Replaced the live Bukkit.getPlayer(uuid) lookup (which returned null after the player logged out, falling back to "Unknown") with a per-world snapshot of the initiating player's name, populated at skip-start. The boss bar and deferred title both read from the snapshot, so attribution survives the player going offline.
  • Sleeping players no longer wake up mid-skip in gradual mode**:
  • Rewrote scheduleGradualSkip to keep world.getTime() parked at the original night value for the entire animation. setTime() is now called exactly once — at the final tick — to snap to the morning target. This prevents vanilla's wake-up threshold (world.getTime() > 23458) from being crossed mid-animation, which previously caused players to be kicked out of bed before the skip's completion effects fired.
  • Listener leak on /onlysleep reload**: AfkTracker and OfflinePlayerTracker no longer register duplicate event listeners on every reload (now properly unregistered).
  • OfflinePlayerTracker stale cache after reload**: shutdown now resets the cached count so the "not loaded" sentinel works again.
  • Off-thread Bukkit calls in update checker**: OP update notifications now dispatch to the main/global th
...
[1.2.0] OnlySleep 1.2.0 by Unknown on May 21, 2026
Download

> For the full changelog, visit the [Onlysleep Wiki](https://github.com/DemonZ-Development/Onlysleep/wiki/Changelog).


## [1.2.0] - 2026-05-21

This release fixes critical bugs across the sleep skip system, AFK detection, config handling, and more.

### 🐛 Bug Fixes

  • Fixed Gradual & Speed Skip Completing Instantly**:
  • Rewrote the time-advance logic using a distance-traveled approach that correctly handles the night→midnight→morning wrap-around. Previously, both modes behaved identically to instant skip because newTime >= 0 was always true on the first tick.
  • Fixed "Good Morning" Message Appearing During Night**:
  • Deferred all completion effects (sounds, titles, messages, cleanup) into a callback that only fires after the gradual/speed timer actually finishes.
  • Speed vs Gradual Now Visually Distinct**:
  • Speed mode (150 ticks/tick, ~2-3s timelapse) and gradual mode (default 30 ticks/tick, ~6-8s sunrise) now feel genuinely different.
  • Fixed Bed Leave Unconditionally Cancelling Skip**:
  • Previously, any single player leaving their bed cancelled the skip for everyone, even if enough players were still sleeping. Now only cancels when the sleeping count drops below the threshold.
  • Fixed Spurious "Cancelled" Message During Gradual Skip**:
  • When vanilla kicked players out of bed at dawn during a gradual transition, a "Player has stopped sleeping" message appeared right before "Good Morning!". Bed-leave events during active transitions are now ignored.
  • Fixed Player Quit Not Rechecking Sleep Status**:
  • When a non-sleeping player quit, the total player count decreased but the sleep threshold wasn't rechecked. Now properly triggers a skip if the remaining sleepers meet the new lower threshold.
  • Fixed CMI AFK Detection Always Failing**:
  • The CMI integration was calling getCMIPlayer() on the Bukkit Player class (which doesn't have that method). Now uses CMI's correct static API: CMI.getInstance().getPlayerManager().getUser(player).
  • Fixed Config Values Containing # Being Stripped**:
  • The ConfigUpdater naively stripped everything after # as an inline comment, breaking values like symbol: "■#test". Now respects quoted strings.
  • Fixed Misleading "No one needs to sleep" Message**:
  • When a skip is already in progress, players now see "The night is already being skipped!" instead of the confusing "No one needs to sleep right now."
  • Removed Duplicate "Monsters Nearby" Message**:
  • Vanilla Minecraft already shows its own "You can't sleep — monsters are nearby" message. The plugin's custom message stacked on top, causing players to see it twice.

### 🛠️ Technical Improvements

  • Gradual/speed timer tasks stored in skipTasks for proper mid-transition cancellation.
  • activeTransitions set tracks worlds currently in mid-transition to prevent spurious cancel/message events.
  • HttpURLConnection in UpdateChecker now properly disconnected in a finally block (prevents socket leaks on 4-ho
...
[1.1.0] OnlySleep 1.1.0 by Unknown on May 21, 2026
Download

> For the full changelog, visit the [Onlysleep Wiki](https://github.com/DemonZ-Development/Onlysleep/wiki/Changelog).


## [1.1.0] - 2026-05-21

This release brings massive stability, compatibility, and user-experience improvements to Onlysleep.

### 🚀 Key Improvements & Bug Fixes

  • 100% Folia/Paper Multi-threaded Stability**:
  • Rewrote internal SchedulerAdapter to resolve reflection lookup issues and method signatures for Folia/Paper multi-threaded environments, preventing region-scheduler crashes.
  • Redesigned task self-cancellation on Folia to interact directly and safely with the region's returned ScheduledTask object via a thread-safe AtomicReference wrapper.
  • Fixed Operator Sleep Exclusion**:
  • Removed onlysleep.exempt from the default OP wildcard permission list in plugin.yml. Administrators and OPs now contribute to sleeping by default instead of being permanently exempt, resolving issues where OPs were unable to trigger night skip.
  • Enhanced Gradual & Speed Transition Modes**:
  • Resolved a critical bug in gradual mode where the skip task would continue running and fast-forwarding time all day.
  • Implemented the "speed" mode as a rapid timelapse fast-forward (150 ticks per tick) utilizing the self-canceling gradual skip engine.
  • PlaceholderAPI Null-Player Safety**:
  • Re-engineered SleepPlaceholderExpansion to process all player-independent placeholders first (e.g. version, platform, percentage, and all world_ statistics), making it completely null-player safe when resolved from consoles, plugins, or non-player contexts.
  • Robust Player Trackers & Initialization**:
  • Fixed unique player count estimation in OfflinePlayerTracker by checking for first-time players (!player.hasPlayedBefore()), preventing require-all-players-online from bypassing offline check.
  • Integrated direct PlayerJoinEvent and PlayerQuitEvent hooks in the built-in AfkTracker to instantly initialize player activity on join and clean up on quit, solving a bug where silent/idle players could never become AFK.
  • Strict Bed-Enter Validation**:
  • Restructured SleepListener to only proceed with sleep registrations when BedEnterResult is explicitly OK (or custom-handled NOT_SAFE), avoiding false-positive skips caused by other failed bed enter attempts.
  • Asynchronous Recurring Update Checker**:
  • Automatically schedules asynchronous update checks every 4 hours (non-blocking) when automatic checking is enabled, rather than only checking once on startup.
  • Smart Configuration Updater**:
  • Implemented an automatic, stateful configuration merger that updates config.yml and messages.yml with new options and comments from the jar resources, fully preserving custom user values, comments, and formatting without overwriting user customization.
  • Safe Update Checks & Null-Safe Commands**:
  • Fixed unescaped brackets and double quotes in the Update Checker query parameters to comply with moder
...
[1.0.0] OnlySleep 1.0.0 by Unknown on May 18, 2026
Download
# Changelog

## [1.0.0] - 2025-06-01

### 🚀 Major Changes
  • Complete rewrite** with modular package structure
  • Folia support** — Full compatibility with Folia's regionized scheduler
  • bStats integration** — Anonymous usage statistics (ID: 31415)
  • Platform detection** — Auto-detects Bukkit, Spigot, Paper, Folia

### ✨ New Features
  • Custom skip types** — Support for instant, speed, and gradual night skips
  • Title/subtitle support** — Configurable titles when night is skipped
  • Sound system** — Fully configurable sounds for skip events
  • AFK detection** — EssentialsX and CMI integration
  • Disabled worlds** — Per-world sleep disabling
  • Advanced player filtering** — Creative mode, flying, and spectator controls
  • Better command system** — /onlysleep status, tab completion improvements
  • Update checker** — Automatic update checks via Modrinth API
  • Progress bar customization** — Configurable symbols and length

## [1.0.0] - Initial Release
  • Basic one-player sleep functionality
  • Configurable sleep percentage
  • Per-world support
  • Boss bar display
  • Basic command system
OnlySleep Icon
Download OnlySleep
Select game version
Select platform