Mayor Elections

Vote for a weekly town mayor whose policies reshape the whole server.

groovyminecraft
On this page 7 sections
  1. How an election runs
  2. The candidates
  3. The bribe
  4. One vote, seven days
  5. Why it’s worth running
  6. Architecture
  7. Trade-offs

The server holds an election every week. A group of candidates stands for office each offering a deal. They offer a bonus paired with a downside. Players get one vote. The person with the votes becomes the mayor for a week. Their policy applies to everyone on the server.

It makes the economy something players argue about.

Edward the Mayor NPC at spawn with the election menu open
Edward the Mayor at spawn

How an election runs

  1. Open the election menu with /mayor. Click Edward the Mayor at spawn.
  2. Read the trade-offs. Each candidate has a bonus and a downside.
  3. Cast your vote by clicking a candidate. Your pick lights up.
  4. Buy votes if you want. Click your candidate again to buy another vote for 100 Gold Coins.
  5. Monday tally. Votes are counted. The winner is sworn in. Every voter gets a reward.

Voting only opens on Saturday and Sunday. The rest of the week the menu is view-only.

The main menu prior to votes opening
The main menu prior to votes opening

The candidates

Each candidate is a trade-off. There’s no vote.

CandidateBonusDownside
NarwhalMoneySome abilities stop working
MimRank costsFewer prestige tokens
ItsCatEnchant chance goes upPickaxe XP goes down
TurtleFishing catch time downLess money
Mayor Turtle's tooltip showing a +50% fishing speed bonus and a -50% money downside, with voting closed
Each candidate spells out its bonus and downside. Here, Turtle trades faster fishing for lighter wallets.

The bribe

You can buy a vote for 100 Gold Coins. There’s no limit.

A candidate's tooltip during open voting, showing the player has voted and the option to click to bribe an extra vote for 100 Gold Coins
During open voting, click a candidate again to bribe an extra vote for 100 Gold Coins.

One vote, seven days

  • One vote per player per week.
  • Bribes are uncapped.
  • The winner is the person with the votes.
  • The term is seven days.
  • Voters get a reward.

Why it’s worth running

  • Giving the economy a rhythm.
  • A reason to log in on the weekend.
  • Server-wide social drama.
  • A currency sink.

Architecture

Shared core, per-server adapters

The election system is written once. It is reused across two gamemodes.

Elections keyed by ISO week

Every election has a key.

One vote per player enforced by the database

votes are stored in a table.

Thread-exactly-once tally

The Monday tally is driven by a background scheduler.

Money is never taken without giving the vote

The bribe charge debits coins.

Effects read a cached value, on hot paths

Mayor effects get read often.

Rewards survive reboots and offline players

At Tally online voters get paid away on their regions world thread. Offline voters have an “owed reward” row. When they log in next the system deletes this row first then gives them the reward. This way a delivery failure can’t give someone credit by mistake. The reward type is added by the adapter the core doesn’t set an economy for a game mode.

Reserve candidates without redeploys

The Skyblock server has 4 reserve” candidates that are fully set up but hidden behind a special flag. Staff can make a reserve candidate live by changing a flag… No need for code or a restart. A developer command can also put any candidate into office for testing. This way what we test is what actually happens.

Source code registering a mayor: the candidate name, its bonus and downside modifiers, and the policy applied while they hold office
Mayor Registry snippet

Trade-offs

  • Bribes are not limited. We could have limited votes per player but we didn’t. This makes elections more competitive. Gives groups something to spend their coins on. It’s okay if someone with a lot of coins buys an election and everyone can see it happening.

  • We use a vote system, not a ranked-choice one. Ranked-choice would be fairer. Its hard to understand in a Minecraft menu. Our system is easy to follow you can look at the vote bar. Know whos winning.

  • The system updates every 30 seconds, not away. A mayors term might end up to 30 seconds late. Players won’t notice and it saves a database update, which is good for performance.

  • Both good and bad effects always happen. We don’t let players pick the good stuff. The bad effect is part of the design it makes a vote a real choice.

The election menu mid-vote, with a row of coloured panes filling in to show each candidate's share of the votes
The vote bar fills in live as players cast their votes, so everyone can see who's winning.