DUXPLIMA Documentation

Statistics and Rating

How kills and deaths are counted, the ELO, fixed and hybrid rating, the modifiers that change it, kill streaks, ranks, anti-abuse, seasons and the Discord log.

Two modules keep score.

ModuleFileDoes
Statisticconfigs/statistic/StatisticSettings.ymlStores every player's numbers, shows /stats, saves to the database
AdvancedStatisticconfigs/statistic/AdvancedStatistic.ymlRating, kill streaks, ranks, anti-abuse, leaderboards, seasons and the Discord log

Both are on by default. With AdvancedStatistic on, it does the counting; with it off, Statistic counts kills, deaths and damage only.

What counts as a kill

A kill is counted when a tag ends with a death or a logout, never from a vanilla death message:

Tag ends withCounted
DEATHThe last attacker gets a kill and a win, the dead player a death and a loss
LOGOUTThe same, with processCombatLogouts: true (the default)
EXPIREDNothing, both walk away
A tag removed by staffNothing

So a tagged player who falls into lava still gives the kill to whoever hit them last, and a player who dies to a mob while not tagged loses nothing.

Wins and losses always move with kills and deaths: in 2.0.0 a win is a kill and a loss is a death.

A kill is not counted when:

CaseWhat happens instead
Killer and victim are in the same team, or allied teamsNothing at all. See teams
Killer and victim have the same IPThe victim gets a death, the killer nothing, and is told why
The victim was AFKThe victim gets a death, the killer an AFK kill and nothing else
The killer already killed this victim maxKillsPerPlayer times within resetTimeMinutesThe victim gets a death, the killer nothing

The last three are the anti-abuse checks.

/stats

/stats shows your numbers, /stats <player> someone else's. The lines are ownStatsFormat and otherStatsFormat in StatisticSettings.yml, and can use every statistic placeholder.

messages:
  ownStatsFormat:
    - "<gold><bold>Your PvP stats"
    - "<gray>Kills: <white>{pvp_kills} <gray>Deaths: <white>{pvp_deaths}"
    - "<gray>Rating: <white>{pvp_rating} <gray>({pvp_rank_displayname})"
    - "<gray>Best streak: <white>{pvp_best_streak}"
KeyDefaultMeaning
processCombatLogoutstrueCount a combat log as a death and a kill
viewOthersPermissionuxmpvpcore.statistic.othersNeeded for /stats <player>
viewOfflinePlayerStatsPermissionuxmpvpcore.statistic.offlineNeeded when that player is offline
playerCache.flushMinutes10Numbers are written to the database every this many minutes, and on shutdown
playerCache.saveOnQuittrueAlso write a player's numbers when they leave
playerCache.keepCacheOnQuittrueKeep a player's numbers in memory after they leave
playerCache.viewCacheDurationMinutes5How long an offline player's numbers stay in memory after someone looked at them

broadcastDeathMessage, deathMessage and maxBattleLogCache are in the file but do nothing in 2.0.0. For a message on every kill, use Kill Messages.

Rating

Every counted kill moves rating: the killer gains, the victim loses. New players start at startingRating, and rating never leaves minRating to maxRating.

Key in ratingSettingsDefaultMeaning
enabledtrueTurns rating on or off. Kills are still counted
modeELOELO, FIXED or HYBRID, below
startingRating1000Rating of a new player
minRating, maxRating100, 3000The lowest and highest rating possible
showRatingChangetrueTell both players how much they gained or lost
showDetailedBreakdownfalseAlso show the killer the mode, base change and multiplier

The three modes

ModeHow much the killer gainsHow much the victim loses
ELOMore for beating a stronger player, less for a weaker one. Up to kFactor (32)The same amount
FIXEDAlways killPoints (25)Always deathPoints (15)
HYBRID70 % of the ELO amount plus 30 % of baseKillPoints (20)70 % of the ELO amount plus 30 % of baseDeathPoints (10)

In ELO, two players with equal rating move 16 points each. A 1000 player who kills a 1400 player gains about 29, while the 1400 player killing the 1000 player gains about 3. This keeps strong players from farming weak ones.

FIXED is simple and predictable. With scaleWithOpponentRating: true, the killer gains scalingFactor (0.01) more per point the victim was rated above them, and less when the victim was rated below. With the defaults, killing a player rated 300 higher gives 28 instead of 25.

ratingSettings:
  mode: HYBRID
  startingRating: 1000
  eloConfig:
    kFactor: 40
  fixedPointsConfig:
    killPoints: 25
    deathPoints: -15
  hybridConfig:
    eloWeight: 0.7
    fixedWeight: 0.3
    baseKillPoints: 20
    baseDeathPoints: -10

Death points are written as negative numbers.

Modifiers

After the mode gives a base amount, modifiers multiply it based on how the fight went. Each is a section in modifierSettings, and globalEnabled: false turns all of them off.

ModifierRaises the killer's gain whenDefault
healthRiskThe killer won with little health leftBelow 50 % health ×1.1, below 25 % ×1.3, below 10 % ×1.5
weaponSkillThe killer won with a weaker or harder weaponPer item, from weapons. Fists ×2.0, trident ×1.6, mace and crossbow ×1.5, bow ×1.4, netherite sword ×0.9. Anything not listed ×1.0
criticalSkillThe killer landed many critical hitsUp to ×2.0 above 30 % critical hits, down to ×0.7 below. Needs 5 hits, a fight of 3 seconds and a victim with 10 armour points
armorThe killer had at least 3 armour points less+0.02 per point, at most +0.25. With 3 or more points more, it lowers the gain by 0.1 per point, at most 0.15
shutdownThe victim was on a kill streak of 3 or more+0.04 per kill of their streak, at most +0.4
gangProtectionThe killer was fighting 2 or more players at once+0.03 per attacker, at most +0.5

gangProtection also protects the victim: when 2 or more players were fighting the victim, the victim loses 15 % less per attacker, at most 60 % less.

All killer multipliers are multiplied together and capped at maxTotalMultiplier (2.0); the victim's protection is capped at maxTotalProtection (0.8, so a victim always loses at least 20 % of the base).

modifierSettings:
  globalEnabled: true
  maxTotalMultiplier: 1.5
  weaponSkill:
    enabled: true
    defaultMultiplier: 1.0
    weapons:
      AIR: 1.5
      BOW: 1.2
      MACE: 1.0
  criticalSkill:
    enabled: false

Every kill writes the change to the console, such as [Rating] Steve killed Alex | Steve: +18.4 ....

Kill streaks

A streak is the number of kills since the player last died. When it reaches a level in killStreakSettings.levels, a message goes to every player with broadcasts on.

StreakNameMessage
3First Blood{player} is on a Killing Spree (3 kills)
5Rampage{player} is on a Rampage
7Dominating{player} is Dominating
10Unstoppable{player} is Unstoppable
15Godlike{player} is Godlike
killStreakSettings:
  enabled: true
  levels:
    3:
      name: Killing Spree
      broadcastMessage: "<gold>{player} <gray>has <gold>3</gold> kills in a row."
      enabled: true
    20:
      name: Legendary
      broadcastMessage: "<red><bold>{player} has 20 kills in a row!"
      enabled: true

Messages can use {player} and the statistic placeholders, not PlaceholderAPI. Only the exact count triggers a message, and killing a player on a streak of 3 or more gives the shutdown bonus.

Ranks

A rank is a rating range. When a player's rating moves into another range after a kill, their rank changes, they get a message, everyone gets a broadcast, and the rank's commands run.

RankRating
BEGINNER0 to 100
AMATEUR100 to 300
SKILLED300 to 600
EXPERT600 to 1000
MASTER1000 to 1500
GRANDMASTER1500 to 2000
LEGEND2000 to 2500
MYTHIC2500 and above

New players start at 1000, so they begin as MASTER. Change the ranges or startingRating so they fit each other.

rankSettings:
  enabled: true
  autoRankUp: true
  broadcastRankChange: true
  ranks:
    - name: BRONZE
      minRating: 0
      maxRating: 1100
      displayName: "<#CD7F32>Bronze"
      commands:
        - "lp user {player} parent set bronze"
    - name: SILVER
      minRating: 1100
      maxRating: 1400
      displayName: "<gray>Silver"
      commands:
        - "lp user {player} parent set silver"
KeyMeaning
nameThe rank's id, shown by {pvp_rank}
minRating, maxRatingThe range
displayNameShown by {pvp_rank_displayname} and in rank messages
commandsConsole commands run when a player enters this rank, going up or down. {player} is the name, {rank} the display name
autoRankUpUpdate ranks after kills. Off, ranks never change
broadcastRankChangeSend rankUpBroadcast and rankDownBroadcast to everyone

Ranks are checked only after a counted kill: a rating changed with /aps set shows the new rank after the player's next fight.

Anti-abuse

penaltySettings keeps players from farming rating. enabled: false turns every check off.

CheckSectionDefault
Same IPipProtectionPlayers on the same IP gain no rating from each other
AFK victimactivityTrackingA victim who has not moved 1 block (minimumMovementDistance) in 5 minutes (afkThresholdMinutes) is AFK
Repeat killskillAbuseProtectionThe same victim gives rating at most 3 times (maxKillsPerPlayer) per 60 minutes (resetTimeMinutes)

Each check has a message sent to the killer. combatLogoutPenalty and afkKillPenalty are in the file but take no rating in 2.0.0.

Teams

File: configs/TeamIntegration.yml. With BetterTeams or TulparClan installed, fights inside a team can be left out.

KeyDefaultMeaning
enabledtrueTurns team checks on or off
providerautoauto picks the installed plugin; or BetterTeams, TulparClan
blockSameTeamStatisticstrueKills between teammates count nothing
blockSameTeamHeadDroptrueTeammates drop no head for each other
allyProtectionEnabledtrueTreat allied teams like teammates for the two settings below
blockAllyStatisticstrueKills between allies count nothing
blockAllyHeadDroptrueAllies drop no head for each other

Team relations also decide the glow colours.

Daily statistics

{pvp_daily_kills} and {pvp_daily_deaths} go back to 0 every 24 hours, counted from when the server started, not at midnight. Only players in memory, those online or seen recently, are reset; others keep their numbers until the next reset that finds them.

Seasons

/resetseason ends a season: it writes the top 10 to the console, saves everyone's statistics to plugins/uxmPVPCore/backups/stats_backup_<date>.json, puts every rating back to startingRating, and clears peak, lowest, gained and lost rating. Kills, deaths and streaks stay. It asks no question, so make a database backup first. Its messages are in seasonResetMessages.

Discord log

discordSettings posts every rated kill to a Discord channel through a webhook.

KeyDefaultMeaning
enabledtrueTurns the log on, once a webhook is set
webhookUrlemptyThe channel's webhook URL. Empty means no log
username, avatarUrluxmPVPCore Logger, emptyHow the sender looks
embedColor#FF5555The embed's colour
embedTitle, embedFooterPvP Kill, uxmPVPCore PvP LoggerIts title and footer
logKillstruePost kills
showCombatDetailstrueAdd damage and fight details
showModifierstrueAdd the rating modifiers

Create the webhook in Discord under the channel's settings, Integrations, Webhooks, and paste its URL.

Related: Leaderboards, Placeholders, Commands