WorldGuard and WorldEdit Integration
This integration provides territory guard behavior for protected-region compatibility and, optionally, high-performance build protection through native WorldGuard region management.
Config Keys
| Key | Default | Description |
|---|---|---|
integrations.worldguard | true | Enable the WorldGuard integration. |
integrations.worldguard-sync-regions | false | Mirror faction claims as WG regions for native build protection (see below). |
Basic Setup
- Install both WorldGuard and WorldEdit.
- Set
integrations.worldguard: true. - Restart and test claim/unclaim behavior in and around protected regions.
Region Sync (Performance Mode)
When integrations.worldguard-sync-regions: true is set, PvPIndex Factions mirrors every claimed chunk as a ProtectedCuboidRegion inside WorldGuard. This allows WG to handle block-break and block-place protection natively, which eliminates database queries on most block events.
How it works:
- WG evaluates events at
NORMALpriority. Faction members are added to their region as WG domain members so WG passes their actions through. - The protection engine runs at
HIGHwithignoreCancelled = true. For enemy players, WG has already cancelled the event before the engine sees it – no DB query is needed. - Allies are not added to WG regions. A secondary
HIGHEST ignoreCancelled = falsehandler un-cancels their events after a lightweight DB check. - Safezone and warzone chunks get WG regions with no members, so WG denies all building there.
Startup sync: on plugin load, all currently-claimed chunks are registered as WG regions. Claim, unclaim, join, leave, and disband events keep the regions up to date while the server is running.
Requirements:
- WorldGuard must be installed and loaded.
- Toggling the option requires a restart.
When to enable: recommended for servers with high claim density or high block-event throughput where DB lookups on every block break become a measurable bottleneck.
Verify
- Attempt territory actions inside a protected region.
- Confirm behavior matches your region policy expectations.