Player Data
ConsentPVP persists each player's PvP consent so it survives restarts and reconnects.
Storage
- File:
plugins/ConsentPVP/playerdata.yml - Keyed by: player UUID.
- Default: players with no stored entry default to PvP disabled.
Load & Save Lifecycle
| Event | What happens |
|---|---|
| Player joins | Their stored consent is loaded from playerdata.yml. |
| Player toggles | Consent is saved immediately when the player runs /pvp enable or /pvp disable. |
| Player quits | Their current consent is saved on quit. |
Offline Cache & Cleanup
ConsentPVP keeps an in-memory cache of consent for responsiveness. To keep that cache tidy, the plugin runs periodic cleanup every 5 minutes, which:
- removes expired toggle cooldowns, and
- clears offline player cache entries that are no longer needed.
This keeps memory usage in check on busy servers without affecting the persisted data in playerdata.yml.
note
Because missing players default to PvP disabled, a brand-new player — or one whose entry was never written — is peaceful until they explicitly opt in with /pvp enable.