> 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/protections.md).

# Protections

/pvp, newbie and respawn protection, anti-clean and duel lock.

When a hit is not allowed, it is cancelled and the attacker is told why in the action bar ("Steve has PvP off", "Steve is a new player and protected"...). These texts are under `protect` in the language files.

Protected players are also safe from the indirect ways: harmful potions don't reach them, pets and explosions don't hurt them, and lava or fire can't be placed next to them by other players.

## PvP switch

Players turn their own PvP on or off with `/pvp on`, `/pvp off`, `/pvp` (the other way) or the button in `/combat`. `/pvp status` tells them how it is.

| Option (`pvp-toggle`) | Default | What it does                                                                     |
| --------------------- | ------- | -------------------------------------------------------------------------------- |
| `enabled`             | `true`  | Players can use `/pvp`. `false` = PvP is always on for everyone                  |
| `default`             | `true`  | PvP of new players                                                               |
| `cooldown`            | `180`   | Seconds between two switches (3 minutes)                                         |
| `forced-worlds`       | `[]`    | Worlds where PvP is always on (an arena world): `/pvp off` doesn't protect there |

* A player with PvP off can't be hit **and can't hit** other players.
* PvP can't be switched while in combat.
* Admins set someone's PvP with `/pvp <on|off> <player>` (permission `rncombat.pvp.others`, which also skips the wait).
* `%rncombat_pvp%` (`on` / `off`) and `%rncombat_pvp_status%` show it on scoreboards.

## Newbie protection

Players who join **for the first time** can't be hit for `newbie-protection.minutes` (15) of **play time**: the time only runs while they are online.

<figure><img src="https://i.imgur.com/56XUMb2.png" alt="The newbie protection boss bar"><figcaption><p>The newbie protection boss bar</p></figcaption></figure>

| Option (`newbie-protection`) | Default | What it does                                                                                                 |
| ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| `enabled`                    | `true`  | New players are protected                                                                                    |
| `minutes`                    | `15`    | Minutes of play time                                                                                         |
| `allow-disable`              | `true`  | Players may end it early with `/newbie disable`                                                              |
| `can-attack`                 | `false` | `false`: newbies can't hit other players either. `true`: they can, and hitting someone ends their protection |
| `block-pvp-loot`             | `true`  | Newbies can't pick up the items dropped by players killed in PvP                                             |
| `boss-bar`                   | `true`  | A green boss bar with the time left                                                                          |

* `/newbie` shows the time left. `/newbie disable` asks first: the player clicks **\[Confirm]** in the chat (or **Yes** in the menu of the button in `/combat`).
* Admins: `/newbie give <player> [minutes]` starts it again, `/newbie remove <player>` ends it (permission `rncombat.newbie.manage`).

## Respawn protection

After respawning, a player can't be hit for `respawn-protection.seconds` (5). `0` = off.

* `ends-when-attacking: true` (default): hitting someone ends the protection.
* `ends-when-attacking: false`: the player can't hit anyone until it ends.

## Anti-clean

`anti-clean-seconds` (0 = off). After a kill, only the players who were part of that fight can hit the killer for this many seconds. Others who were waiting to "clean" the winner while they are weak get "Steve just won a fight and is protected for a moment".

## Duel lock

`duel-lock: true` (off by default). Two players fighting each other can't be hit by anyone else, and they can't hit anyone else, until their fight ends. Useful for servers that want clean 1v1s.

## Worlds without any of this

Worlds in `disabled-worlds` are left alone: no combat, no protections, no restrictions and no rewards.
