--- type: User Story title: "US-002: Relinquish protection when attacking" description: Remove Leaf protection when an opted-in player attacks another player. status: backlog --- # US-002: Relinquish protection when attacking As a **player facing PvP**, I want Leaf protection to belong only to non-aggressors so that protected players cannot keep its advantage after fighting back. ## Acceptance criteria - [ ] When an opted-in player damages another player, Leaf automatically changes the attacker's saved choice to opted out. - [ ] Automatic opt-out immediately removes Leaf-managed Resistance and the attacker's leaf prefix. - [ ] The attacker receives a clear chat message explaining that attacking another player disabled Leaf and that they may opt in again when permitted. - [ ] Receiving player-caused damage without retaliating does not change the protected player's choice or Resistance. - [ ] Retaliatory damage counts as attacking, including Thorns damage attributable to the protected player. - [ ] Direct melee attacks and player-fired projectiles are attributed to the attacking player. - [ ] Harmful splash or lingering potion damage is attributed to the player who threw the potion. - [ ] Damage caused by a tamed animal is attributed to its player owner when Spigot exposes that ownership. - [ ] TNT, fire, and other indirect damage trigger opt-out only when Spigot exposes a reliable responsible player; ambiguous environmental damage does not opt out an innocent player. - [ ] PvP-triggered opt-out applies even when an administrator has locked the player's preference. - [ ] A single attack produces no duplicate state changes or duplicate notifications. ## Related - [US-001: Opt into Leaf protection](us-001-opt-into-leaf-protection.md) - [US-003: Identify protected players](us-003-identify-protected-players.md) - [US-005: Administer Leaf](us-005-administer-leaf.md)