A simple paper plugin that rewards players with tokens when they vote for your server on voting websites
SimpleVote Plugin
SimpleVote is a lightweight Minecraft Paper 26.1.2 plugin that rewards players with tokens when they vote for your server on voting websites. Although it was custom built for minecraftoffline.net, any server can use it.
Features
- Rewards players with tokens for voting
- Clickable list of voting sites for players
- Automatically handles online and offline player voting
- Admin commands to manage tokens
Installation
- Download the latest release from GitHub.
- Place the
.jarfile in your server'spluginsfolder. - Restart your server to generate the default configuration.
- Set up your server on voting sites using the public key displayed on startup or with the
/votekeycommand.
Setting Up Votifier
Port Forwarding
For voting websites to send votes to your server, you must ensure that the Votifier port (default: 8192) is open and forwarded to your server. This typically involves:
- Setting up port forwarding in your router's configuration
- Ensuring your firewall allows incoming connections on the specified port
- If using a hosting provider, check their documentation for port configuration
Registering on Voting Sites
Voting sites may show a Public Key field, a Token field, or both. Fill in whichever fields the site provides:
- Public Key: paste the RSA public key. Run
/votekey keyin-game, or copyvotifier.public-keyfromplugins/SimpleVote/config.yml. - Token: paste the HMAC token. Run
/votekey tokenin-game, or copyvotifier.tokenfromplugins/SimpleVote/config.yml.
Running /votekey on its own prints both values at once.
Both values are generated automatically the first time the server starts. You never need to create or edit them manually.
To register:
- Start your server with SimpleVote installed.
- On the voting site's registration page, enter your server's public IP and Votifier port (default:
8192). - Paste the public key, the token, or both, depending on what fields the site provides.
Troubleshooting
- If votes aren't being received, check that:
- The Votifier port is correctly forwarded.
- You pasted the correct value into the correct field on the voting site (public key or token).
- Your firewall permits access on the Votifier port.
In-game Commands
/tokens: Check your current tokens/tokens [player]: Check another player's tokens (requires permission)/tokens give [player] [amount]: Give tokens to a player (admin only)/tokens take [player] [amount]: Take tokens from a player (admin only)/tokens set [player] [amount]: Set a player's tokens (admin only)/votesites: Display a list of clickable voting site links/votekey: Display both the public key and token (admin only)/votekey key: Display the public key only/votekey token: Display the token only
Permissions
simplevote.tokens: Allows checking own token balance (default: true)simplevote.tokens.others: Allows checking others' token balances (default: op)simplevote.votesites: Allows viewing voting sites (default: true)simplevote.admin: Allows managing tokens and accessing admin commands (default: op)
API for Developers
Setup Dependencies
Download the latest
SimpleVote.jarand place it in alibsdirectory - and then add this to yourbuild.gradlefile:dependencies { compileOnly files('libs/SimpleVote-2.3.jar') }If SimpleVote is absolutely required by your plugin, then add this to your
plugin.ymlfile - and this means if SimpleVote is not found then your plugin will not load:depend: [SimpleVote]
Getting SimpleVote Instance
You can import SimpleVote into your project through using the below code:
import org.bukkit.Bukkit;
import com.jellypudding.simpleVote.SimpleVote;
Plugin simpleVotePlugin = Bukkit.getPluginManager().getPlugin("SimpleVote");
if (simpleVotePlugin instanceof SimpleVote && simpleVotePlugin.isEnabled()) {
SimpleVote simpleVote = (SimpleVote) simpleVotePlugin;
}
Available API Methods
// Get the TokenManager instance
TokenManager tokenManager = simpleVote.getTokenManager();
// Get player's current token balance
int currentTokens = tokenManager.getTokens(playerUUID);
// Add tokens to a player
tokenManager.addTokens(playerUUID, 10);
// Remove tokens from a player (returns true if successful, false if insufficient tokens)
boolean success = tokenManager.removeTokens(playerUUID, 5);
// Set player's exact token amount
tokenManager.setTokens(playerUUID, 50);