> For the complete documentation index, see [llms.txt](https://realisticnode.gitbook.io/rnsetups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://realisticnode.gitbook.io/rnsetups/rncombatpvp/guides/kills-and-rewards.md).

# Kills and rewards

Rewards, money, drops, heads, anti-farm, assists, streaks, rating and the death recap.

## What counts as a kill

* A player killed by another player, with any weapon, projectile, pet or explosion.
* A player who dies by the void, lava, a fall, fire or an explosion **shortly after being hit** by a player (within the combat time plus 2 seconds): the last player who hit them gets the kill.
* A [combat log NPC](/rnsetups/rncombatpvp/guides/combat-log.md) killed by a player.

Dying by yourself, with no player hit before, ends your streak but gives nobody a kill. Nothing is counted in `disabled-worlds`.

The killer gets "You killed Steve with 6.5❤ left. Streak 3 · Rating 1016 (+16)". The victim gets the [death recap](#death-recap).

## Money

Needs Vault and an economy plugin.

| Option (`kills`)   | Default | What it does                                                                |
| ------------------ | ------- | --------------------------------------------------------------------------- |
| `money`            | `0`     | Money the killer gets from the server                                       |
| `steal-percent`    | `0`     | Percent of the victim's money that goes to the killer                       |
| `death-penalty`    | `0`     | Money the victim loses: an amount (`250`) or a percent (`"5%"`)             |
| `xp-steal-percent` | `0`     | Percent of the victim's dropped experience that goes straight to the killer |

## Reward actions

`kills.rewards` runs for the killer on every kill. The same kind of lines are used for streaks, assists, bounties and combat logs.

```yaml
kills:
  rewards:
    - "[actionbar] <green>+1 kill <gray>({victim})"
    - "[money] 50"
    - "[console 10%] give {player} diamond 1"
    - "[sound] minecraft:entity.player.levelup 1 1"
```

| Action                             | What it does                       |
| ---------------------------------- | ---------------------------------- |
| `[console] <command>`              | Runs a command from the console    |
| `[player] <command>`               | Runs a command as the player       |
| `[message] <text>`                 | Sends a message to the player      |
| `[broadcast] <text>`               | Sends a message to everyone online |
| `[title] <title>\|<subtitle>`      | Shows a title                      |
| `[actionbar] <text>`               | Shows a text in the action bar     |
| `[sound] <sound> [volume] [pitch]` | Plays a sound to the player        |
| `[money] <amount>`                 | Gives money (needs Vault)          |

* **Chance**: add a percent inside the brackets: `[console 25%] give {player} diamond 1` runs one time in four.
* **Placeholders**: `{player}` (who gets the action), `{killer}`, `{victim}`, `{streak}`, `{world}`, `{x}`, `{y}`, `{z}`. Assist rewards also have `{percent}`, bounty rewards `{amount}`.
* PlaceholderAPI placeholders work in commands and texts. Texts use MiniMessage or `&` colors.
* A line that doesn't start with `[type]` is skipped and reported in the console.

## Drops

`kills.drops` changes what a player killed in PvP drops (other deaths are not touched):

| Mode       | What happens                                                                                 |
| ---------- | -------------------------------------------------------------------------------------------- |
| `NORMAL`   | Vanilla drops                                                                                |
| `KEEP`     | The victim keeps their items and level                                                       |
| `TRANSFER` | The items go straight to the killer's inventory; what doesn't fit drops at the killer's feet |
| `CLEAR`    | Nothing drops                                                                                |

`TRANSFER` does nothing when another plugin already keeps the victim's inventory. The same modes apply to a killed [combat log NPC](/rnsetups/rncombatpvp/guides/combat-log.md).

### Loot protection

`kills.loot-protection` (10 seconds, `0` = off): only the killer can pick up the victim's drops for that time. After it, anyone can.

With `newbie-protection.block-pvp-loot: true`, players with newbie protection can't pick up items dropped by PvP deaths.

### Heads

`kills.head-drop-chance` (percent, `0` = off): the victim's head drops with this chance. With `TRANSFER` it goes to the killer's inventory.

## Anti kill-farm

Killing the same victim too often, or a player on the same IP (alt accounts), gives **nothing**: no rewards, money, stats, rating, streak, bounty, head or experience. The victim's own streak still ends, and the killer is told "You killed Steve too often: this kill gives nothing."

| Option (`kills.anti-farm`) | Default | What it does                                                                                   |
| -------------------------- | ------- | ---------------------------------------------------------------------------------------------- |
| `max-kills`                | `3`     | Kills of the same victim that count...                                                         |
| `minutes`                  | `10`    | ...in this many minutes. More than that are farmed. `max-kills: 0` = only the IP check         |
| `same-ip`                  | `true`  | Kills between players with the same IP are farmed                                              |
| `commands`                 | `[]`    | Console commands run the first time a player passes the limit. `{player}` = killer, `{victim}` |

Players with `rncombat.bypass.farm` are never stopped.

## Assists

Everyone who did at least `kills.assists.min-percent` (25) of the damage the victim took in that fight gets an **assist**: +1 in their stats, the actions of `kills.assists.rewards`, a message and a sound. The killer doesn't get an assist for their own kill.

```yaml
kills:
  assists:
    min-percent: 25
    rewards:
      - "[money] 20"
      - "[actionbar] <aqua>Assist on {victim} ({percent}%)"
```

## Kill streaks

A streak is the number of kills in a row without dying. The best one is kept in the stats.

```yaml
kills:
  streaks:
    milestones:
      5:
        - "[broadcast] <gold>{player} <yellow>is on a <gold>5 <yellow>kill streak!"
      10:
        - "[broadcast] <gold>{player} <yellow>is unstoppable: <gold>10 <yellow>kills in a row!"
        - "[sound] minecraft:entity.ender_dragon.growl 0.6 1.2"
    ended-at: 5
    ended:
      - "[broadcast] <gold>{player} <yellow>ended <gold>{victim}<yellow>'s streak of <gold>{streak}<yellow>!"
```

* `milestones`: actions for the killer when their streak reaches that number. Add as many as you want.
* `ended` runs for the killer when they end a streak of at least `ended-at`. Here `{streak}` is the streak that was ended.
* With a Discord webhook, milestones from `discord.streaks-from` (10) on are posted on Discord.

## Rating (ELO)

With `kills.rating.enabled: true`, every player starts at `kills.rating.start` (1000). The winner takes points from the loser, more when they beat a better player:

* Two players with the same rating: the winner gets **+16** and the loser **-16** (with `k-factor: 32`).
* Beating someone 200 points above you gives about +24; beating someone 200 below gives about +8.

`k-factor` sets how much one fight moves the rating. The rating shows in the kill message, in `/combat stats`, in the top lists and in `%rncombat_rating%`.

## Death recap

With `kills.death-recap: true`, the victim gets who killed them, how much health the killer had left, and one line for each player who hurt them, with the damage and the percent. **Hover a line** to see the hits and the last weapon.

<figure><img src="https://i.imgur.com/KBoIXiW.png" alt="The death recap in the chat, with the hover of one line"><figcaption><p>The death recap in the chat, with the hover of one line</p></figcaption></figure>

* `/combat recap` opens the last death in a menu, and `/combat recap chat` shows it in the chat again. It is kept for an hour.
* Each player can turn the chat recap off in `/combat` settings: they then get one short line ("You were killed by Alex").

<figure><img src="https://i.imgur.com/XoNrq41.png" alt="/combat recap: who did how much damage"><figcaption><p>/combat recap: who did how much damage</p></figcaption></figure>

## Stats and top lists

`/combat stats [player]` shows kills, deaths, K/D, current and best streak, assists, rating and combat logs. `/combat top [kills|kdr|streak|rating|assists]` shows the best players; click one for their stats.

<figure><img src="https://i.imgur.com/1lZnzmF.png" alt="/combat stats"><figcaption><p>/combat stats</p></figcaption></figure>

<figure><img src="https://i.imgur.com/v35FYoZ.png" alt="/combat top"><figcaption><p>/combat top</p></figcaption></figure>

* The K/D list only has players with 5 kills or more. The streak list is the best streak.
* `/combat resetstats <player>` sets a player's stats back to zero and their rating to the start value (permission `rncombat.stats.reset`).
* Every value is also a [placeholder](/rnsetups/rncombatpvp/reference/placeholders.md), top lists included.
