# GriefPrevention3D v18.3.10
**Wiki:** https://github.com/castledking/GriefPrevention3D/wiki
## Overview
Two fixes for the per-claim PvP toggle on **admin claims**:
1. Admin claims (e.g. a spawn claim) became PvP-enabled **automatically** — "PvP Enabled" flipped on
without anyone toggling it;
2. `/claim pvp` (and its confirm step) was rejected on admin claims even for OP players.
## Root cause
### Auto-enabled PvP
`pvpEnabled` defaults to `true`. The v18.3.8 fix made the per-claim toggle authoritative in both
directions: `claimIsPvPSafeZone` returned `!claim.pvpEnabled` whenever the toggle feature was
enabled for that claim type. But that treated *every* claim's default value as an explicit toggle —
so any claim that had never been touched was reported as PvP-enabled, overriding the global
`PvP.ProtectPlayersInLandClaims.AdministrativeClaims` protection. A spawn admin claim silently lost
its PvP safety.
### Cannot toggle admin claims
`handlePvpCommand` gated on `claim.hasExplicitPermission(player, ClaimPermission.Edit)`. Admin
claims have no owner and no trust lists, so that check can never pass — only the explicit-grant map
matters there. OP players were blocked even though `claim.checkPermission` does honor the
`griefprevention.adminclaims` permission on admin claims.
## Fix
### Explicit-toggle tracking
Claims now carry a `pvpToggleSet` marker that records whether `pvpEnabled` was actually set by a
player (`/claim pvp … confirm`), rather than left at its default. `claimIsPvPSafeZone` only applies
the per-claim override when that marker is set. Claims that were never toggled fall back to the
global no-combat config, so:
- **never-toggled** claims: follow `PvP.ProtectPlayersInLandClaims.*` exactly as before
(admin claims included — no more surprise PvP-on);
- **explicitly disabled** claim: PvP blocked, attacker told why;
- **explicitly enabled** claim: combat allowed, overriding any global no-combat fallback;
- the "already toggled" message now only fires for an *existing explicit* state, so enabling a
default-protected claim still arms the override instead of reporting "already enabled".
The marker is persisted:
- flat file: new `PvP Toggle Set` key (defaults to missing/false);
- database: new `pvptoggled BOOLEAN DEFAULT 0` column (auto-added, schema version 13 → 14);
- cross-platform claim document: carried as a schema event-field so it survives claim moves.
Subdivisions created with `Subdivision.DefaultState: INHERIT` inherit the parent's marker along
with its `pvpEnabled`.
### Admin-claim permission
Both the toggle command and its confirm step now use
`claim.checkPermission(player, ClaimPermission.Edit)` instead of `hasExplicitPermission`. This lets
players holding `griefprevention.adminclaims` (including consoles/ops) enable and disable PvP on
admin claims, while everyone else is still denied.
## Upgrade notes
No configuration changes. Storage upgrades automatically:
- **Database users:** the migration adds the `pvptoggled` column on startup; no manual SQL needed.
- **Existing flat-file data:** the new key is optional and defaults to false.
One behavior note: claims that were explicitly toggled *before* this release lose their explicit
marker once and return to global-config behavior. Re-run `/claim pvp` on those claims to mark them
again. Drop-in replacement for v18.3.9.
Optional dependencies
PlaceholderAPI
Any compatible version
VaultUnlocked
Any compatible version
QuickShop-Hikari
Any compatible version
Developer information
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle.
maven { name = "Modrinth"; url = "https://api.modrinth.com/maven" }