Skip to main content

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

EventWhat happens
Player joinsTheir stored consent is loaded from playerdata.yml.
Player togglesConsent is saved immediately when the player runs /pvp enable or /pvp disable.
Player quitsTheir 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.