SinglePlayerSleep2
Because I can't access my old account I had to start this one. I will be updating the plugin for all the versions of minecraft that have come out while I've been gone.
For versions of minecraft older than 1.12 download the appropriate version of SPS for your MC version here... http://dev.bukkit.org/bukkit-plugins/singleplayersleep/
Introduction:
First off, I watch several Hermitcrafters, and after seeing them have issues with their Single Player Sleep command block, rain messes it up. I decided to make this simple plugin.
Product Description:
When a player right clicks on a bed, the plugin broadcasts " is sleeping [CANCEL]", if no one clicks on Cancel, then after 10 seconds the plugin will advance the time ahead to the next morning. thus the day and difficulty is not affected. The plugin also checks for storms, and if the player has the permissions, it will clear them. There is also a permission for the Cancel command.
New feature starting 2.13.31, DaySkipper: A player with a Black bed, and the sps.dayskipper permission may skip the day to night, also can require an item named DaySkipper in config.yml.
New feature starting 2.13.43, support for nicknames from VentureChat and Essentials, also includes RGB support for those nicknames.
New feature starting 2.13.44, colors in sleepmsgs. See new config.yml for details, may have to pull from jar.
Sleepmsg examples:
# Color codes are now usable in sleepmsgs, Example: <BLACK>Black<RESET>Reset
# RGB format is §xFF00FF (§xFFFFFF<player> §x000000i§x999999s §x111111s§x888888l§x222222e§x777777e§x333333p§x666666i§x444444n§x555555g)
# THERE MUST BE A COLOR CODE IN FRONT
sleepmsg1: §xFFFFFF<player> §xFF0000is §xFF7F00s§xFFFF00l§x00FF00ee§x0000FFpi§x4b0082n§x9400D3g
sleepmsg2: §xFFFFFF<player> §x00FFFFwent to bed. Sweet Dreams
sleepmsg3: <YELLOW>Shhh! §xFFFFFF<player> §xFF0000is §xFF00FFtrying §x0000FFto §x00FF00sleep!
sleepmsg4: §xFFFFFF<player> §xFF00FFis asleep at the wheel
sleepmsg5: §xFFFFFFNO ONE<colon> ...\n§xFFFFFF<player><colon> §xFFFF00go to bed.
Languages supported:
# Available languages čeština (cs_CZ), Deutsch (de_DE), English (en_US), Español (es_ES), Español (es_MX), Français (fr_FR), Italiano (it_IT), Magyar (hu_HU), 日本語 (ja_JP), 한국어 (ko_KR), Lolcat (lol_US), Melayu (my_MY), Nederlands (nl_NL), Polski (pl_PL), Português (pt_BR), Русский (ru_RU), Svenska (sv_SV), Türkçe (tr_TR), 中文(简体) (zh_CN), 中文(繁體) (zh_TW)
Known conflicts:
I was made aware that Essentials's permission "essentials.sleepingignored" conflicts with SPS.
Messages.yml:
# DO NOT CHANGE VERSION
version: 1.0.1
# Set msgs for random sleep msgs here "sleepmsg#: <player> msg here"
# Don't forget the space between : and the start of the message.
# Color codes are now usable in sleepmsgs, Example: <BLACK>Black<RESET>Reset
# RGB format is §xFF00FF (§x§F§F§F§F§F§F<player> §x§F§F§A§A§0§0went to bed. Sweet Dreams)
# take Hex code replace hashmark with §x then place § before each character in the Hex code.
# THERE MUST BE A COLOR CODE IN FRONT
messages:
sleep:
count: 5
message_1: §xFFFFFF<player> §xFF0000is §xFF7F00s§xFFFF00l§x00FF00ee§x0000FFpi§x4b0082n§x9400D3g
message_2: §xFFFFFF<player> §xFFAA00went to bed. Sweet Dreams!
message_3: <YELLOW>Shhh! §xFFFFFF<player> §xFF0000is §xFF00FFtrying §x0000FFto §x00FF00sleep!
message_4: §xFFFFFF<player> §xFF00FFis asleep at the wheel
message_5: §xFFFFFFNO ONE<colon> ...\n§xFFFFFF<player><colon> §xFFFF00go to bed.
dayskip:
count: 2
message_1: <WHITE><player> <WHITE>wants to <BLUE>sleep <WHITE>the <YELLOW>day <WHITE>away...
message_2: §xFF0000<player> §xFF7F00wants §xFFFF00to §x00FF00sleep §x0000FFthe §x4B0082day §x4B0082away§xFFFFFF...
Permissions:
sps.hermits:
description: Allows one player to change the time to day when using a bed. Without clearing local difficulty.
default: true
sps.unrestricted:
description: Allows the player to sleep uninterrupted. Other players will not be able to cancel it.
default: false
sps.downfall:
description: Clears Downfall upon SPS sleep.
default: false
sps.thunder:
description: Clears Thunderstorm upon SPS sleep
default: false
sps.cancel:
description: Allows canceling Single Player Sleep.
default: true
sps.command:
description: Allows player to use the /sleep command, instead of a bed.
default: op
sps.update:
description: Allows the player to check for updates.
default: op
sps.op:
description: Overrides all permissions.
default: false
sps.showUpdateAvailable:
description: Shows player that there is a version update.
default: op
sps.dayskipper:
description: Allows one player to change the time to night when using a bed. Without clearing local difficulty.
default: false
sps.dayskipcommand:
sps.command:
description: Allows player to use the /dayskip command, instead of a bed.
default: op
If the player is the only one player online, then the bed functions as normal, since the sleep function works before the 10 second delay.
config.yml:
# DO NOT CHANGE VERSION
version: 1.0.9
#
# Change to false to stop auto-update-check.
auto_update_check: true
#
# Set to true before sending a log about an issue.
# Logs trace data required to pinpoint where errors are.
debug: false
#
# Set the language to use, en_US, nl_NL, lol_US, fr_FR, de_DE, zh_CN, cs-CZ, pt_BR
lang: en_US
#
# Set Blacklist worlds, Names are Case Sensitive, World does not equal world
blacklist:
sleep: world_nether, world_the_end
dayskip: world_nether, world_the_end
#
# Should broadcasts be per world, or server wide? (Should be true for multiverse)
broadcast_per_world: true
#
# Should SPS reset the time_since_rest stat for all players in the world that the sleeping player is in?
reset_insomnia: false
#
# Enables fancy ANSI colors in console.
colorful_console: true
#
# Set whether to allow player to stop rain when it is not night.
clearrain_enabled: false
#
# If true this will disable all broadcast messages and allow anyone to sleep.
unrestrictedsleep: false
#
# Set wake time, Early (23000) or Normal (24000)
waketime: NORMAL
#
# Delay between sleep, and change to day, in seconds. Minimum 1, recommend 10.
sleepdelay: 10
#
# Enable(true) or Disable(false) dayskipper
enabledayskipper: false
# Delay between request for DaySkip, and change to night, in seconds. Minimum 1, recommend 10.
dayskipdelay: 10
# If true this will disable ability of players to cancel DaySkipper
unrestricteddayskipper: false
# Require DaySkipper item
dayskipperitemrequired: true
#
# Set the color of the [CANCEL] link text in broadcast messages. Format RED
# Colors: AQUA, BLACK, GOLD, GRAY, BLUE, GREEN, RED, YELLOW, WHITE
# DARK_AQUA, DARK_BLUE, DARK_GRAY, DARK_GREEN, DARK_RED, DARK_PURPLE, LIGHT_PURPLE
# MAGIC, BOLD, STRIKETHROUGH, UNDERLINE, ITALIC, RESET
cancelcolor: RED
cancelbracketcolor: YELLOW
# Sleep message color, see above
sleepmsgcolor: WHITE
# Player name color, see above
playernamecolor: WHITE
#
# Set to true to have SPS cancel sleep if the player exits their bed.
exitbedcancel: false
# Set if cancel is shown or not.
display_cancel: true
# Set to true to broadcast "<player> canceled sleep."
# Set to false not to broadcast that message.
cancelbroadcast: true
#
# Set the time limit in seconds which a player must wait between attempting to sleep again.
# This prevents a user from spamming chat with sleep messages.
# Set to 0 to disable.
sleeplimit: 60
# Set the time limit in seconds which a player must wait between attempting to cancel again.
# This prevents a user from spamming chat with cancel messages.
# Set to 0 to disable.
cancellimit: 60
#
# Set whether the player should be told it must be night to use.
notifymustbenight: false
#
# Should SPS use the Player's DisplayName(true) or UserName(false), if they have no set Nickname?
nickname:
usedisplayname: true
#
# Set to true to use random sleep msgs.
randomsleepmsgs: true
Commands:
/sps - shows help /sps reload - reloads configs. /sps update - checks for updates. /sleep - command to sleep instead of using bed, requires permission. /spscancel - cancels sleep, or dayskip, if either is scheduled. /dayskip - command to dayskip instead of using bed, requires permission.
For help you can post issues and suggest ideas on my discord server.
License:
MIT License
This plugin utilizes bStats to collect anonymous statistics
Contributing:
This plugin is open source; you can view the source code on github. Feel free to open issues there or submit pull requests.
If you like this, check out my other plugin,
SinglePlayerSleep, NoEndermanGrief,
DragonDropElytra, ShulkerRespawner,
Noticed that in my config I have:
# Enable(true) or Disable(false) dayskipper
enabledayskipper: true
# Delay between request for DaySkip, and change to night, in seconds. Minimum 1, recommend 10.
dayskipdelay: 10
# If true this will disable ability of players to cancel DaySkipper
unrestricteddayskipper: false
# Require DaySkipper item
dayskipperitemrequired: false
But when running the the check command:
[11:05:14] [Server thread/INFO]: sps.hermits=true, sps.cancel=true, sps.unrestricted=false, sps.downfall=false, sps.thunder=false, sps.command=true, sps.update=true, sps.op=false, sps.showUpdateAvailable=true, sps.dayskipper=false, sps.dayskipcommand=true
It says that dayskipper is disabled.
I noticed the black bed system isn't working, perhaps that's why? Any idea how to resolve this?
In reply to teenyplx:
You need the permission "sps.dayskipper" to use the feature.
Hello and good day!
I'm sorry if I sound stupid, but I have never dealt with plugins before.
I tested this plugin on my server but it seems only OP players are able to skip the day and the black bed is not working for that either, only the command works.
I tried everything and searched everywhere but I don't know how to add the permission to regular players to do that, neither how to enable the black bed to do it. I'd really appreciate some help.
Thanks!
In reply to MisterVloop:
Which Permissions plugin do you use?
I suggest LuckPerms, the command for luck perms is
/lp group default permission set sps.dayskipper true
to set the permission true for all players, to set it for a group replace default with the group name.
In reply to joelhstoner:
Thank you very much!
I didn't know I needed a perms plugin. I did it and the command is working fine, not the black bed clicking. But actually I don't think I want the black bed skipping day.
Thanks a lot again.
How do I make it so only 1 person needs to sleep?
In reply to Sp1cyCookie:
Setup a server that is based on bukkit(CraftBukkit, spigot, paper, etc) download this plugin and place it in the plugins folder for the server, and start the server.
how do i disable the chat messages entirely?
In reply to DCWatkins5:
You can give everyone the permission sps.unrestricted, or set unrestrictedsleep:true in the config.yml.
hi the sleep plugin no longer shows the name of whos sleeping only FFFFF is sleeping?
In reply to ossie_ostler:
I can help you faster on https://discord.gg/PXN4bzT
There is a language file update for es_MX, at https://github.com/JoelGodOfwar/Sin..._2.13.45.D3/src/main/resources/lang/es_MX.yml
Right click and select save as to download, or copy paste it to your current es_MX.yml for the updated translations provided by agBAZE
Hi,
can you fix up this shorter?
https://pastebin.com/embed_iframe/HTTRjmcG
In reply to FarLokus:
This is fixed in v1.13_2.13.45.2
In reply to joelhstoner:
THX
Hello, i want to disable the plugin in some worlds.
Is there a permission i need to negate or a worldlist of enabled worlds that i can set?
In reply to Forge_User_86994830:
UPDATE: I have added this feature in a Dev version, if you'd like to try it. Simply go to my Discord server, and look in the SinglePlayerSleep#dev_builds channel.
Sorry this was an oversight, I had intended to add that feature to SPS after I had added it to MoreMobHeads, but forgot about it. It will be added ASAP.
I'm not sure if you can set permissions per world or not. The relevant permission would be 'sps.hermits'
Hey there! Love the plugin! Super simple and all the players on the server find it so convenient.
Just one question: is there anyway I could have multiple lines in one sleep message?
For example, I'd like one of the sleep messages to look like this.
no one: ...
<player>: go to bed.
I know the colon will probably not work so I can replace that, just sort of using it here to demonstate the idea. I think this would be a silly sleep message to have appear every now and then, but I'm not sure how to have it send in separate lines. Does anyone know of a way I might be able to do this?
Once again, super lovely plug in.
Thanks!!!
In reply to tritheist:
try doing it like this "no one: ...\n<player>: go to bed."
Hi, singleplayersleep works great for brief period of time on my server before it starts giving this error in the logs: Could not pass event PlayerBedEnterEvent to SinglePlayerSleep v1.13_2.13.41 org.bukkit.event.EventException: null. Is there a way to possibly fix this, or is it something with the server?
Thanks