promotional bannermobile promotional banner

SleepVote

Allows players to vote to set the server time to day and skip night
<p>SleepVote header</p>

SleepVote header

Description

SleepVote

1.6 has dramatically increased the difficulty of Minecraft's mobs, especially at night. Swarms of zombies can appear without warning, overwhelming even skilled players who haven't dug themselves in before the sun sets. On larger servers, night is almost unavoidable because it is so difficult to get everyone either in a bed or in a different realm.

This mod allows players to propose a vote to set the server time to 'day' and thus skip the night. This is much easier than wrangling a dozen players into beds, and you don't have to worry about that one AFK guy keeping everyone up. It is quite simple, easy to use and install, highly configurable, and will not bog down your server.

There has to be a majority voting for day (/sleepvote yes) in order for the time to be changed. If people are AFK the fact that they don't vote won't affect the result, because only active 'no' (/sleepvote no) votes affect the tally.

To everyone updating to a new version, be sure to delete your old config.yml files!

Change Log

VersionChanges
1.0Original version, basic vote proposal and not much else.
1.1Added configurable settings.
1.2Improved error messaging, added the dowry feature.
1.2.5Added the ability to display the 'score' and VIP permissions.
1.2.8Modified the display slightly.
1.3Updated to work with new versions of MC/Bukkit/Spigot.
1.3.1Added the "night is coming" and "times per night" features.

Commands

CommandFunction
/sleepvoteGives a list of commands.
/sleepvote newStarts a new vote to set the time to day.
/sleepvote yesVotes for setting the time to day.
/sleepvote noVotes against setting the time to day.

Permissions

PermissionAffect
sleepvote.voteAllows the user to vote when a vote is in progress.
sleepvote.proposeAllows the user to propose a new vote.
sleepvote.*Allows proposing and voting. Does not include the sleepvote.vip permission!
sleepvote.vipIncreases the relative weight of the player's vote by a configurable amount, so for example one VIP vote might equal two regular votes.

Configuration

This plugin, when first ran, will create a config file in your plugins folder within a folder called SleepVote. This config file allows a great deal of customization/optimization for server operators. Please reload the plugin after you make a change to this config file.

VariableAffectSyntaxDefault
restrict (vote, propose)Turns on/off restriction of voting/proposing votes. When 'true' users require permissions to perform either. Restrictions on voting and proposing can be done separately to restrict one but not the other.true/falsetrue
cooldowninsecondsThe amount of time after a failed vote during which votes cannot be proposed.seconds60
timespernightThe number of times each night a vote can be proposed. Independent of cooldown.integer10
votedurationinsecondsThe amount of time users have to vote before the result is calculated.seconds60
autovoteonproposeWhen set to 'true' whoever proposes the vote automatically votes in favor of the time change.true/falsetrue
marginofvictoryThe vote must pass by this margin in order to be successful and change the time.integer1
requiredowryWhen set to true, players will have to pay a 'dowry' to 'propose' a vote. The item earmarked for payment must be in their inventory and will be taken from them once the vote is proposed.true/falsefalse
dowrymaterialThis is the item the player proposing the vote must have. Coal, iron ingots, gold ingots, and diamond are all possible currencies.coal/iron/gold/diamondgold
dowryquantityThis is the quantity of the item the player proposing the vote must have.integer1
displayWhen set to '1', whenever someone votes the entire server will be updated on the score of the vote. When '2', whenever someone votes their name and vote is broadcast. When '3', both occur. When '0', none of these events occur and the vote is private.0/1/2/30
vipvotebonusThis is the value of a VIP vote. 0 means it is worth nothing, 1 is a normal vote, 2 is worth two normal votes, etc.integer2
nightiscomingWhen set to 'true' the server will propose its own vote automatically as soon as the sun starts setting.booleanfalse

Installation

Start by dragging SleepVote.jar into your plugins folder and reloading/restarting your server. A config file will be generated in the plugins/SleepVote folder. Next, open said config file and make any changes you wish to. Reload the plugin after changing said file. See the above Configuration table for details, syntax etc. Lastly, set up your permissions. I recommend giving everyone the sleepvote.* permission, but you can restrict the permissions if you wish. Again, see the above tables for details on this.

FAQ and Troubleshooting

Q. How does a vote work? First, a player proposes a vote. Second, the other players (and the guy who proposed the vote, unless autovoteonpropose is set to true) vote yes/no. After votedurationinseconds seconds, if 'yes' has a majority greater than or equal to marginofvictory the time is set to day - otherwise, the night continues.

Q. How does this affect normal beds? Players can still sleep normally - beds are not affected. Any players asleep when the time changes will stay in bed until they click the "leave bed" button.

Q. What about AFK players? Won't they mess it up? Anyone who does not vote will not affect the vote outcome. If only 1 guy votes yes, but nobody votes no, it will pass.

Q. What about all the mobs roaming around? Will they despawn? Mobs will not despawn and as such it is recommended you begin the vote as early in the evening as possible. Votes can be proposed as soon as it is night. Skeletons and zombies will burn and spiders will become docile, but creepers (and hat-wearing mobs) still present a hazard.

Q. This won't work on my server! I get a nullpointer exception! Your world name includes _the_end or _nether, in which case _nether or _the_end will be removed and the world will be incorrectly identified, and you should rename your world. You might also get this issue with a multiworld plugin due to the different world names. Please report your map name in the comments to help me debug for the next version.

To Do

WeatherVote, to set the weather to sunny; NightVote, to set the time to night for creeper hunting, torch placement etc; upload a new demo video of the plugin; any other suggestions you guys make in the comments!

Credits

Special thanks to Darq for helping me with my first plugin and schedulers, Motherurck for giving me the idea, Otter for suggesting players pay to propose a vote, thebighud and PK for helping test and debug the script, and the GTAF server (especially the 4Rs - Rown, Rdny, Rhyn and Ryan) for being awesome and helping me out. Credit for the header goes to ElMafias from GTAF, thanks again man! Thanks to Mariskaaa for suggesting the score be visible, PsychoNavigator for suggesting I update it, and DrkMatr1984 for suggesting the automatic vote by the server.

Other Plugins You Might Find Useful

MC Eunuch - disables a variety of grief-y functions for user groups, including damage of livestock and players, interaction with chests and horse inventories, block breaking, item pickup, and farmland trampling.

The SleepVote Team

profile avatar
  • 2
    Projects
  • 2.8K
    Downloads

More from _ForgeUser9688893

  • MC Eunuch project image

    MC Eunuch

    • 530
    • Bukkit Plugins

    A lightweight anti-griefing plugin to restrict noob actions while still allowing exploration of your world/builds.

    • 530
    • January 3, 2015
    • Bukkit Plugins
    • +1
  • MC Eunuch project image

    MC Eunuch

    • 530
    • Bukkit Plugins

    A lightweight anti-griefing plugin to restrict noob actions while still allowing exploration of your world/builds.

    • 530
    • January 3, 2015
    • Bukkit Plugins
    • +1