# PvP & Security

Combat tag, anti-logout, anti-spawn-camp, anti-stash, pet protection, death-loot protection, sieges and the ignore/soft-mute system.

## PvP rules

```yaml
PvP:
  Enabled: true                 # global master switch
  RulesEnabledInWorld:          # decides PER WORLD whether PvP happens
    "*": false                  # default: PvP off everywhere, enable worlds explicitly
  CombatTimeoutSeconds: 15      # how long you count as in combat after the last hit
  BlockedCommands: [home, spawn, tpa, tpaccept, tpahere, warp, back, tp, teleport, rtp]
  AllowCombatItemDrop: false    # dropping items in combat
  ProtectPlayersInLandClaims:   # victim location decides
    PvPWorld: false
    NonPvPWorld: true
  ProtectPlayersInAdminLandClaims: true
  ProtectPlayersInSubdivisions: false
```

Whether PvP runs in a world is decided solely by `RulesEnabledInWorld`. In blocked worlds the damage is cancelled; in allowed worlds both participants are combat-tagged (including projectiles).

| Additional permissions | Default | Description |
|---|---|---|
| `coreengineclaim.nopvpimmunity` | false | Waives PvP protection in non-PvP worlds AND fresh-spawn invincibility |
| `coreengineclaim.siegeimmune` | false | Cannot be sieged |

> **Warning:** Without at least one `true` world in `RulesEnabledInWorld` the whole combat system (anti-logout, anti-stash, command block) never triggers, since it needs a PvP hit to happen first.

> **Tip:** Claim PvP protection has two deliberate exceptions: an already combat-tagged victim stays attackable (no escape-claim mid-fight), and during a siege between the participants it is lifted. `AllowPearlsToPvpZones` is a reserved key with no function; ender pearls are governed by `Claims.EnderPearlsRequireAccessTrust`.

**Combat tag:** every hit extends both players' tag. Red boss bar with countdown, expires automatically, removed on death. On logout the status persists (for the anti-logout penalty) and the bar returns on rejoin.

**Command block in combat:** the first word of every command is checked against `BlockedCommands`; GUI teleports are also caught. Bed, end portal and world changes stay free.

## Anti-logout

`PvP.PunishLogout: true` (default): if a combat-tagged player logs out, their full inventory is dropped at their location (with death-loot protection), health is set to 0 and the action is written to the audit log.

## Anti-spawn-camp

`PvP.ProtectFreshSpawns: true` (default): invincibility for `FreshSpawnDurationSeconds` (10 s) on every respawn and on the very first login, with a green boss bar.

The protection ends instantly if the protected player attacks or picks up an item (the pickup is still blocked then). Splash potions bounce off without ending it.

## Anti-stash

Combat-tagged players cannot drop items (`AllowCombatItemDrop: false`) and cannot open foreign inventories (chests, furnaces, ender chests, even CoreEngine menus). Own inventory and crafting stay free.

## Pet protection

Applies to tamed wolves, cats, parrots, horse-likes, axolotls, foxes and allays.

| Action | Rule |
|---|---|
| Damage | Only the owner hits (also projectiles); environment damage stays |
| Feed/lure | Owner only |
| Leash | Owner only |
| Ride | Owner always; others only with access trust in a claim of the owner at the spot |
| Re-tame | Rejected if the animal already belongs to someone |

| Command | Syntax | Permission | Default | Description |
|---|---|---|---|---|
| Give pet | `/givepet` | (no permission checked) | true | Selection mode: next right-click on your own animal, then name entry + confirmation |

> **Tip:** `/givepet` checks ownership three times (selection, entry, confirmation) and can be disabled via `Pets.EnableGivePetCommand: false`.

## Death-loot protection

All death drops are pickup-only by the owner for `PvP.LootProtectionSeconds` (180 s); `<= 0` disables the marking.

| Command | Syntax | Permission | Default | Description |
|---|---|---|---|---|
| Unlock own drops | `/claim unlockdrops` | `coreengineclaim.claim.unlockdrops` | true | Unlocks your protected drops |
| Unlock foreign drops | `/claim admin unlockdrops <player>` | `coreengineclaim.claim.admin.unlockdrops` | false | Unlocks foreign drops server-wide |

## Sieges

Optional, off by default.

```yaml
Sieges:
  Enabled: false
  MaxDurationSeconds: 1800
  Worlds: []        # empty = all worlds allowed
```

| Command | Syntax | Permission | Default | Description |
|---|---|---|---|---|
| Start siege | `/claim siege <player>` | `coreengineclaim.claim.siege` | true | Sieges a player in their own claim |

Start conditions: system on, world allowed and a PvP world, target online, not `siegeimmune`, neither already in a siege, both standing in the target's claim. On start both are combat-tagged; the attacker may build and break in the sieged claim.

Ends on: death of a participant, defender leaves their claim, logout (triggers the anti-logout penalty) or timeout.

## Ignore & soft-mute

Independent of PvP.

| Command | Syntax | Permission | Default | Description |
|---|---|---|---|---|
| Ignore | `/ignoreplayer <player>` (`/ignore`) | (no permission) | true | Hides a player's chat |
| Unignore | `/unignoreplayer <player>` (`/unignore`) | (no permission) | true | Stops ignoring |
| List | `/ignoredplayerlist` (`/ignorelist`) | (no permission) | true | Shows your ignore list |
| Soft-mute | `/softmute <player>` | `coreengineclaim.softmute` | false | Only visible to other soft-muted players |
| Separate | `/separate <p1> <p2>` | `coreengineclaim.admin` | false | Forces mutual ignoring |

| Additional permissions | Default | Description |
|---|---|---|
| `coreengineclaim.notignorable` | false | Cannot be ignored or soft-muted |
| `coreengineclaim.eavesdrop` | false | Reads private messages (`/msg`, `/tell`, ...) |
| `coreengineclaim.eavesdropsigns` | false | Gets every new sign text reported |

> **Note:** `Spam.Enabled` is a reserved placeholder with no function (CoreEngine handles chat moderation). No SmartBan/anti-alt system exists; use a separate plugin for that.

## Full example config

```yaml
PvP:
  Enabled: true
  RulesEnabledInWorld:
    "*": false
    pvp_world: true
  ProtectFreshSpawns: true
  FreshSpawnDurationSeconds: 10
  PunishLogout: true
  CombatTimeoutSeconds: 15
  AllowCombatItemDrop: false
  BlockedCommands: [home, spawn, tpa, tpaccept, tpahere, warp, back, tp, teleport, rtp]
  ProtectPlayersInLandClaims:
    PvPWorld: false
    NonPvPWorld: true
  ProtectPlayersInAdminLandClaims: true
  ProtectPlayersInSubdivisions: false
  LootProtectionSeconds: 180

Sieges:
  Enabled: true
  MaxDurationSeconds: 1800
  Worlds:
    - pvp_world

Pets:
  EnableGivePetCommand: true
```
