Skip to content
Ignacio Pozo edited this page Jun 4, 2021 · 15 revisions

SuperbVote is designed to be flexible, so we've put effort into making it a highly configurable vote listener.

Example

# SuperbVote configuration
# A superb vote plugin made by Tux.
#
# https://github.com/minecrafter/SuperbVote/wiki

# Once you've configured SuperbVote, add it to our official server list, CraftServers.net:
# Official server list: https://www.craftservers.net/

# Database configuration.
storage:
  database: json
  json:
    file: votes.json
  mysql:
    host: 127.0.0.1
    username: root
    password: topsecret
    database: superbvote
    table: votes
    read-only: false

# General vote configuration.
votes:
  # At least this many seconds must pass before allowing another vote (per-service). This will apply per service.
  # Default: 3600 seconds (1 hour)
  cooldown-per-service: 3600

  # Whether or not to treat fake votes as real votes
  process-fake-votes: true

# Rewards. This is the main section you will need to edit. Ordering is important.
rewards:
  # Example of matchers. See https://github.com/minecrafter/SuperbVote/wiki/Configuration#if for a full list of available
  # matchers.
  - if:
      permission: superbvote.test
      chance-percentage: 5
      service: SpecialService
    commands:
    - give %player% diamond 4
    - eco give %player% 1000
    player-message: "&aThanks for meeting nearly impossible conditions, you have been rewarded with 4 diamonds and $1000."
    broadcast-message: "&a%player% got really lucky and was rewarded with 4 diamonds and $1000!"
  # A default reward is required. Default rewards are defined by using default: true as a matcher. No other matchers can
  # be used with this matcher and only one such reward can be the default reward.
  - if:
      default: true
    commands:
    - eco give %player% 1000
    player-message: "&aThanks for voting for us on %service%, you have been rewarded with $1000."
    broadcast-message: "&a%player% has voted for us on %service% and was rewarded with $1000!"

# Whether or not players need to be online to vote. If set, offline player votes are queued for when the player next logs in.
require-online: true

# Broadcast settings:
broadcast:
  # Should we broadcast votes at all?
  enabled: true

  # Should we tell players if they voted?
  message-player: true

  # Should we broadcast queued votes?
  queued: true

# Vote command.
# See http://www.minecraftforum.net/forums/minecraft-discussion/redstone-discussion-and/351959-1-9-json-text-component-for-tellraw-title-books
# and https://www.minecraftjson.com for json text format
vote-command:
  enabled: false
  use-json-text: false
  text: |-
    You could vote for us, but the owner forgot to add the list of websites to vote at!

# Vote reminder.
vote-reminder:
  message: "&cDon't forget to vote for us! You currently have &a%votes%&c votes."
  on-join: true
  repeat: 180

# Controls the /sv <top/leaderboard> command.
leaderboard:
  # Supported: text, scoreboard
  display: text

  # The text format supports pagination.
  text:
    per-page: 10
    header: "&c&m         &r&b Top Voters &r&c&m         &r"
    entry: "&e%num%. &7%player% (&e%votes%&7 votes)"
    page: "&7(page %page%/%total%)"

  # Control the scoreboard.
  scoreboard:
    title: Top voters
    max: 10

# Control top player signs.
top-player-signs:
  format:
  - "#%num%"
  - ""
  - "%player%"
  - "&l%votes% &rvotes"

Options

storage

database

This specifies the storage for votes. Currently, only 'json' and 'mysql' storage is supported.

json options

  • file: Where the votes should be stored, relative to the SuperbVote plugin directory.

mysql options

  • host: Where your MySQL server is running.
  • port: The port where your MySQL server is listening.
  • username: The username used to authenticate to MySQL.
  • password: The password used to authenticate to MySQL.
  • database: The database where you are storing voting data.
  • table: The table where the voting data will be stored.

votes

cooldown-per-service

If someone has voted on this service, they must wait this specific period of time before being allowed to vote again. Default is 3600 seconds (one hour).

process-fake-votes

Whether fake votes should add votes to the vote database. Default is true.

rewards

This is a list of rewards to dispense.

Order is important; the first condition that is met will be used, unless you are using cascading. This means that if you have a default reward at the very beginning, then it will be used first and your other rewards won't work!

SuperbVote always requires a reward that matches, even when require-online: true. You need one reward with default: true (or no matchers in the if section). If you don't do this, the plugin will refuse to work until one is added.

if

This option specifies the conditions that must be met in order for the reward to be given to the player.

  • default: Marks the default reward. Can't be used with any other matcher and can only appear once in your configuration. (Previous versions used an empty if: {} block to accomplish this. For backwards compatibility, this is still supported.)
  • permission: Matches if the player has the specified permission. Requires that the player be online to be able to match this reward.
  • chance-fractional: Matches if a 1/x chance is met. For instance, if this is set to 8, then one out of eight times, this reward will match.
  • chance-percentage: Matches if a x% chance is met. For instance, if this is set to 8, then this reward will match with 8% probability.
  • service: Matches if the vote came from the specified server list.
  • services: If no service matcher is specified, then match if the service used is in this list.
  • cumulative-votes: Matches if exactly x votes have been made (including the vote currently being made).
  • every-cumulative-votes: Matches if the the current number of votes (including the current vote) is a multiple of x.
  • script: Runs the matchVote function of a specified JavaScript file using Nashorn. Learn more at Script Matcher.
  • group: Matches if the voter is in the specified group. Requires Vault. (While this can work without require-online: true, it is highly recommended to set it to ensure the proper world is used.)
  • groups: If no group matcher is specified, then match if the voter is in the specified groups. Requires Vault. (While this can work without require-online: true, it is highly recommended to set it to ensure the proper world is used.)
  • world: Matches if the player is in the specified world. Requires that the player be online to be able to match this reward.

commands

Specifies the commands to execute to dispense the reward. Placeholders available:

  • %player%: The current player's name.
  • %player_uuid%: The current player's UUID (with dashes).
  • %service%: The service where the vote originated.

player-message / broadcast-message

Specifies the message to broadcast to the player and to all players, respectively. Color codes may be used. Placeholders available:

  • %player%: The current player's name.
  • %service%: The service where the vote originated.
  • %votes%: The current number of votes the player has.
  • Optional: clip's PlaceholderAPI placeholders may be used if the player is online. require-online is recommended in this case.

allow-cascading

Whether or not to continue looking for vote rewards if this reward matches. If this is false (or not set), and one of your reward matches, no more matching is done, even if previous rewards were cascaded.

require-online

If set, the player must be online or the reward will not be dispensed until the player logs in.

broadcast

This option allows you to tweak broadcasting. It can be disabled entirely or queued votes can be disabled.

Optional: clip's PlaceholderAPI placeholders may be used if the player is online. require-online is recommended in this case.

vote-command

Allows you to toggle and edit the contents of the /vote command.

vote-reminder

Vote reminders were introduced in 0.1.1.

message

Specifies the message to broadcast to players to remind them to vote. Placeholders available:

on-join / repeat

on-join reminds the player to vote when they log in, repeat will repeat the message every x seconds specified.

To disable the vote reminder entirely, set on-join to false and repeat to -1.

leaderboard

display

Lets you modify how the leaderboard is displayed.

  • text: The default. Supports pagination.
  • scoreboard: Shows the players in a scoreboard. No pagination supported.

text options

  • per-page: Lets you modify the number of players shown per page (default is 10).
  • header: The header displayed with /sv top.
  • entry: The display for all entries in /sv top. Placeholders available are %num% (position in the leaderboard), %player% (the player's name) and %votes% (the player's current vote count).

scoreboard options

  • title: Allows editing the scoreboard's title.
  • max: Lets you control the maximum number of players displayed on the leaderboard. Default is 10, can only be 16 maximum.

top-player-signs

format

This is a list with the format for signs. You can use the same placeholders as for #text options.