-
Notifications
You must be signed in to change notification settings - Fork 0
Placeholders
Onlysleep provides 19+ placeholders when PlaceholderAPI is installed. Placeholders are automatically registered when Onlysleep detects PlaceholderAPI on your server.
- Install PlaceholderAPI on your server
- Restart or reload your server
- Onlysleep will automatically register its placeholders (check console for:
"PlaceholderAPI expansion registered!") - Verify with:
/papi ecloud list(Onlysleep should appear) - Use placeholders in any plugin that supports PlaceholderAPI (scoreboards, nametags, etc.)
| Placeholder | Description | Example |
|---|---|---|
%onlysleep_sleeping% |
Number of sleeping players in the player's world | 3 |
%onlysleep_required% |
Number of players required to skip night | 10 |
%onlysleep_percentage% |
Configured sleep percentage value | 50 |
%onlysleep_total% |
Total eligible player count in the world | 20 |
%onlysleep_progress% |
Percentage of required sleepers achieved (0-100) | 30 |
%onlysleep_progress_bar% |
Visual progress bar of sleep progress | โ โ โ โ โโโโโโ |
%onlysleep_sleeping_names% |
Comma-separated list of sleeping player names | Steve, Alex, Notch |
%onlysleep_status% |
Player's sleep status |
Sleeping, AFK, or Awake
|
%onlysleep_is_sleeping% |
Whether the player is sleeping |
true / false
|
%onlysleep_skipping% |
Whether night skip is currently scheduled |
true / false
|
%onlysleep_enabled% |
Whether sleep is enabled in the player's world |
true / false
|
%onlysleep_is_sleepable% |
Whether it's night/storm currently |
true / false
|
%onlysleep_is_night% |
Whether it's currently night time |
true / false
|
%onlysleep_afk% |
Whether the player is AFK |
true / false
|
| Placeholder | Description | Example |
|---|---|---|
%onlysleep_version% |
Plugin version | 1.0.0 |
%onlysleep_platform% |
Server platform name |
Folia, Paper, Spigot, Bukkit
|
These placeholders let you query specific worlds by name:
| Placeholder | Description | Example |
|---|---|---|
%onlysleep_world_sleeping_<world>% |
Sleeping count in a specific world |
%onlysleep_world_sleeping_world% โ 3
|
%onlysleep_world_required_<world>% |
Required count in a specific world |
%onlysleep_world_required_world_nether% โ 5
|
%onlysleep_world_total_<world>% |
Total eligible in a specific world |
%onlysleep_world_total_world_the_end% โ 8
|
Note: World names with underscores may conflict with the placeholder syntax. For example,
world_the_endworks because the placeholder becomes%onlysleep_world_total_world_the_end%, which parses asworld_total_prefix +world_the_endas the world name.
With plugins like Scoreboard-replacer, TAB, or GriefDefender:
lines:
- "&7Sleeping: &b%onlysleep_sleeping%&7/&b%onlysleep_required%"
- "&7Progress: &b%onlysleep_progress%%"
- "&7Status: &b%onlysleep_status%"{onlysleep_sleeping} players sleeping out of {onlysleep_required} required
nametags:
suffix: " &7[%onlysleep_status%]"Use the /papi parse command to test placeholders:
/papi parse %player_name% %onlysleep_sleeping%
/papi parse %player_name% %onlysleep_progress_bar%
/papi parse %player_name% %onlysleep_status%
Returns one of three values based on the player's current state:
| Value | Condition |
|---|---|
Sleeping |
Player is currently counted as sleeping (in bed and registered) |
AFK |
Player is AFK according to built-in tracker, EssentialsX, or CMI |
Awake |
Player is active and not sleeping |
Returns true if the player's world is currently in a state where sleeping would work:
| Condition | Time Range | Returns |
|---|---|---|
| Night time | 12542 โค time โค 23458 | true |
| Storm / Thunder | Any time during storm | true |
| Day + Clear weather | Everything else | false |
Calculated as: (sleepingCount / requiredCount) ร 100, capped at 100.
| Sleeping | Required | Progress |
|---|---|---|
| 0 | 10 | 0% |
| 5 | 10 | 50% |
| 10 | 10 | 100% |
| 12 | 10 | 100% |
A visual bar using the configured progress bar symbol and length from config.yml. For example, with 5 out of 10 players sleeping and a length of 20:
โ โ โ โ โ โ โ โ โ โ โโโโโโโโโโ
Returns comma-separated names of currently sleeping players:
Steve, Alex
Returns None if no players are sleeping.
Onlysleep โ Developed by Demonz Development with โค๏ธ for the Minecraft community.
Licensed under the MIT License.
Links:
๐ Website ยท ๐ป GitHub ยท ๐ฎ Modrinth
๐ฆ Twitter/X ยท ๐ฅ YouTube ยท ๐ธ Instagram
๐ Discord ยท ๐ Reddit ยท ๐ demonzdevelopment@gmail.com