pie_flavor / Consensus

Allows players to vote for things to happen.
Download

Consensus

Consensus is a plugin that allows players to vote on various things. Players can start a vote with /poll <mode> <args>. A message will pop up in chat saying that this player has started the poll. If a player clicks the vote button, they will vote ‘Yes’ on the poll. Once the poll has passed, its effects will occur. You can also set a poll to automatically start to change the time to day if it becomes nighttime, or to clear the weather if it starts to rain.

Note on the arguments

Wherever a duration is requested, the format is [nD][nH][nM][nS]. So two days, one hour, and four seconds would be represented 2D1H4S. This is applicable both in commands and in the config.

Poll types

mute <player> [duration] <reason>: Votes to mute the player for the specified amount of time for the specified reason. If no duration is specified, the configured maximum duration is used.

kick <player> <reason>: Votes to kick the player for the specified reason.

ban <player> [duration] <reason>: Votes to kick and ban the player for the amount of time for the specified reason. If no duration is specified, the configured maximum duration is used.

time <time> [world]: Votes to set the time of day in the specified world. If no world is specified, the poll creator’s world is used.

weather <weather> [world: Votes to set the weather in the specified world.
If no world is specified, the poll creator’s world is used.

command <command>: Votes to run the specified command from the console’s perspective. Note that any command must be whitelisted before it can be run.

dummy <text> [majority] [duration]: Makes an empty vote; i.e. one that occurs and executes but doesn’t actually do anything. Useful for personal polls, admin surveys, etc.

As the only command absent from configuration, its majority and duration are specified in the command; if either is not present, they default to 0.5 and 1M respectively. See the configuration section for details.

To include spaces in text, surround it in double quotes (e.g. /poll dummy "add a new map").

Configuration

Every single configuration option is optional. If you leave them out, a sane default will be used.

All mode settings blocks have four common fields: enabled, whether or not this mode is enabled; majority, the fraction of players needed to pass the vote; min-players, the number of players required to be online for a vote of this type to start; and duration, how long a vote of this type lasts before resolving.

ban{}: The ban mode has an extra setting, max-duration, which is the maximum duration that someone can be banned for.

kick{}: No extra settings.

mute{}: The mute mode has an extra setting, max-duration. See ban{} for details.

time{}: No extra settings.

weather{}: No extra settings.

command{}: The command mode has one extra setting, allowed-commands[]. This is a list of commands that are allowed to be used. It supports subcommands, such as warp set.

triggers{}: This section contains sections for automatic triggers, time{} and weather{}. Within each, there are three fields: enabled, whether or not this automatic trigger is enabled; worlds[], a list of world names; and type, whether worlds[] is a whitelist or blacklist.

Permissions

consensus.exempt.ban: A player with this permission cannot be votebanned.
consensus.exempt.kick: A player with this permission cannot be votekicked.
consensus.exempt.mute: A player with this permission cannot be votemuted.
consensus.override.ban: A player with this permission can vote to ban players with consensus.exempt.ban or for longer than max-duration. consensus.override.kick: A player with this permission can vote to kick players with consensus.exempt.kick. consensus.override.mute: A player with this permission can vote to mute players with consensus.exempt.mute or for longer than max-duration. consensus.override.command: A player with this permission can vote to run a command that is not whitelisted in allowed-commands[].

Suggestions

The modules I’ve included are from a few forum threads asking for a way to have players vote on things - I’d love to add as many more as possible. If you have an idea for a useful module, suggest it!

Changelog

1.0.0: By majority vote, these details won’t be released.

1.1.0: Added the command mode.

1.1.1: Fixed the bug where everything broke.

1.1.2: Fixed minimum player settings.

1.2.0: Added weather and automatic triggers.

Note

This plugin uses bStats, which collects data about your server. This data is in no way intrusive, is completely anonymized, and has a negligible impact on server performance, so there is no reason whatsoever to disable it. However, if you wish to anyway, simply set enabled to false in config/bStats/config.conf.

Category: Miscellaneous

Published on Jan 16, 2017

1123 views

102 total downloads

Pages

Members