Skip to main content
Dan's Plugins Community
All guidesDemocracy plugin page

Democracy Guide

0

Democracy User Guide

What is Democracy?

Democracy is a Spigot plugin that adds democratic elections to Medieval Factions servers. Faction leaders can start elections, and faction members can run as candidates and vote for them. Naming a winner and making them faction leader is not implemented yet: an election stays in progress until the faction leader cancels it.

Requirements

Installation

  1. Download the latest Democracy-<version>.jar from the Releases page.
  2. Place the JAR (and the Medieval Factions JAR) in your server's plugins/ folder.
  3. Restart the server.

How Elections Work

  1. The current faction leader runs /d start to begin an election.
  2. Any faction member can run /d run to declare their candidacy, or /d dropout to withdraw it.
  3. Faction members vote using /d vote <candidate>.
  4. Use /d info to check the current election status and vote tallies.
  5. The faction leader can run /d cancel to cancel the election. No winner is named; the election, its candidates and its votes are discarded, and a new election can then be started with /d start.

An election in progress survives a server restart: elections, candidates and votes are saved to elections.json, candidates.json and voters.json in plugins/Democracy/ each time /d start, /d cancel, /d run, /d dropout or /d vote changes them, and again when the server stops, and loaded again when it starts. A server that crashes rather than stopping cleanly therefore keeps every change a player was told had succeeded; if a save fails, the cause is reported in the console. If one of those files cannot be read, the plugin reports it in the console and disables itself, leaving the files untouched so they can be repaired. There is not yet a way to conclude an election with a winner, so a faction's election stays in progress until its leader cancels it with /d cancel.

An election belongs to a faction by its name (ignoring case), not to the faction itself. If a faction is renamed while its election is in progress, its members no longer see that election — /d info, /d run, /d vote and /d cancel all report that there is none — and its leader can start a new one. The old election, with its candidates and votes, is kept under the old name, and so is an election whose faction is disbanded. Any faction that later has that name, including a new faction founded under it, finds the old election as its own.

Who Can Start, Run and Vote

  • Starting or cancelling an election needs a faction role with Medieval Factions' DISBAND faction permission, which by default only the Owner role has. So by default only the faction owner can start or cancel one; another member, and a player in no faction, are refused.
  • A player can only take part in their own faction's election: running and voting both apply to the election of the faction the player is in. Members of other factions, allies included, cannot run or vote in it; if their own faction has no election, they are told so.
  • Players in no faction can neither run nor vote.
  • Each player can vote once per election, for a player who is running in it; a second vote is refused and the first one stands.
  • A candidate can drop out of their faction's election with /d dropout; a player who is not running in it is told so, and a player in no faction is refused. Votes already cast for a candidate who drops out are discarded, and the players who cast them cannot vote again in that election. A candidate who drops out can run again with /d run, starting from zero votes. If the server crashed during the drop-out, a leftover candidate record can make /d run report that the candidacy could not be recorded. The record can be cleared by removing it from candidates.json while the server is stopped, or by the faction leader running /d cancel, which discards the whole election.

Permissions

PermissionDefaultDescription
d.defaulttrueView the plugin's version, author and a link to this guide with a bare /d. Registered for permission plugins, but not yet checked: a bare /d works without it.
d.helptrueView the help menu.
d.infotrueView election information.
d.runtrueRun as a candidate.
d.dropouttrueDrop out of an election.
d.votetrueVote in an election.
d.starttrueStart a faction election.
d.canceltrueCancel a faction election.

Support

Ask questions in the Discord server or open a GitHub issue.

Back to topDemocracy plugin pageView this guide on GitHub