Sleeper+

Sleeper+

3.5k Downloads

Feature Request: Randomly select from X many messages in config.yml

Cameronsplaze opened this issue · 3 comments

commented

I'm looking at switching away from SinglePlayerSleep to this plugin for a couple reasons. The main feature I'll miss however is how they have a list of ~5 messages when you sleep, and'll choose one at random for each night. It's a nice way to for each night not to be repetitive, and not get the same joke every night. In this plugin, it could take the format of:

NightSkip:
  - "&aSleep > &7People are trying to sleep, skipping the night."
  - "&aSleep > &7People are sleeping, §l§ctime to be quiet§r"
  - "etc"

You can't break on new-lines in case people have existing ones in their messages. This would keep that functionality. You can also check the value of "NightSkip", and if it's a string, it's the older style with a single message. It won't break existing configs either then.

I also plan on setting SkipPercentage to 1% so just one player has to sleep to skip the night. The number of players sleeping wouldn't be as useful then, but exactly who is would be. For those of us with small private servers, is there a variable (like %count%, maybe something like %sleeping%?), that lists all the names of all sleeping players?

commented

Sounds like a good idea, and thanks for the suggested implementation. I'll try to have a look at this when I have time to work on it.

commented

I read through the source code a bit, and figured a way to solve my second ask above! If I set BroadcastSleepInfo: true, the SleepInfo message field also supports using the %player% field. You can do the classic SleepInfo: "&aSleep > &7%player% has started to sleep, time to be quiet" already!

Because of that, I can get more creative with the SleepInfo messages over NightSkip, if only one could be a list.

commented

The night skip messages can now be set as a list and are randomly chosen in the latest release.