Resource icon

Spigot 💦 PvP Elo 2023.10.15-R1

Documentation

  • /pvpelo (alias: /elo) arguments:
    • check - Checks your elo
    • top - Displays the top 10 players, based on elo
  • /pvpeloadmin(alias: /eloadmin, /eloa) arguments:
    • adjust <username> <int>
      • Adds to a player's elo rating. Negative numbers are supported.
    • set <username> <int>
      • Sets a player's elo to a specific value.
    • reset <username>
      • Resets a player's elo to the initial elo value, defined below.
    • resetall
      • Resets every player's elo to the initial elo value, defined below.
      • Useful for breaking rankings into "seasons."
    • initial <int>
      • Sets the initial elo that new players are granted.
    • baseadj <int>
      • Sets the base elo adjustment for players of equal rating.
    • maxadj <int>
      • Sets the maximum elo adjustment for a fight.
    • maxratio <int>
      • Sets the max rating ratio between the winner and loser of a fight. If exceeded, adjustment is reduced to 0.
    • maxportion <double>
      • Sets the max percentage (in decimal) of a defeated player's elo that can be lost in a single fight.
    • prefix <String>
      • Sets the plugin's prefix for command output.
      • Uses &-based color codes.
    • color <String>
      • Set the color of the rating when displayed in chat and nametags.
      • Uses &-based color codes.
      • Technically can add more than just a color, if you want. Whatever is entered presents before the numerical rating.
    • nametags
      • Toggles nametags
    • gui
      • Toggles between GUI and chat leaderboards
    • world <String>
      • Gets the next argument and toggles elo tracking for the named world
      • Tab-completes based on server's world list
      • Fails if internal boolean allEnabled is true, or if world is not found
    • allworlds
      • Toggles internal boolean allEnabled, toggling between server-wide and per-world tracking
    • disabledworldmessage
      • Toggles disabled-world-message

  • pvpelo.basic- Grants the use of the /elo command
    • Available to all without permission
  • pvpelo.admin - Grants the use of the /eloadmin command

Chat formatting is simple, and is handled by whichever chat formatting plugin you use. To add a player's rating to their display name, simply add "varElo" in the chat plugin's chat format. This variable is replaced by the player's numerical elo rating, colored with the color set by /eloadmin color.

Code:
# Config file for PvP Elo. Please use in-game commands to modify the plugin's configuration.
# Support the author! https://ko-fi.com/leeneighoff

# Worlds where combat contributes to ranking
# Default: All worlds
enabled-worlds:
- "%all%"

# Should PvP Elo send a message when a player kills/is killed in PVP outside enabled worlds?
disabled-world-message: false

# Elo rating for new players.
# Default: 1000
initial-elo: 1000

# Base adjustment when two players of equal rating fight.
# Default: 75
base-adjustment: 75

# Maximum adjustment possible after a single fight.
# Default: 500
max-adjustment: 500

# The maximum rating ratio between a winner and loser before adjustment is reduced to 0.
# Discourages bullying of low-rated players by high-rated players.
# Default: 5 or 5:1 ratio
max-ratio: 5

# The maximum portion of a victim's elo to adjust by.
# Prevents someone from losing most/all elo in some situations.
# Default: 0.25 or 25% of victim's rating
max-portion: 0.25

# Prefix that appears with every command output.
# Default: "&8[&9PvP Elo&8]&r"
prefix: "&8[&9PvP Elo&8]&r"

# Color for a player's elo in each chat message.
# Default: "&9"
elo-color: "&9"

# Enables nametags support with NametagEdit. https://www.spigotmc.org/resources/nametagedit.3836/
# Default: false
nametags: false

# Whether /elo top opens as a GUI or list in chat
# Default: true
leaderboard-gui: true

# Please do not modify elo here.
players:
00000000-0000-0000-0000-000000000000: 1

Here's the secret sauce.

Code:
Formula: adjustment = (int) ((victimElo / killerElo) * baseAdjustment)

Modifiers (in order of priority):
1. Adjustment is reduced to 0 if victim's rating is 1
2. Adjustment is reduced to 0 if rating ratio between killer and victim is higher than 5:1 (configurable)
3. Adjustment is capped to 25% of victim's elo (configurable)
4. Adjustment is capped to max adjustment (configurable)
Back
Top