Install it
WorldGuard requires WorldEdit or FastAsyncWorldEdit. Download both for your server version, put them in plugins, and restart.
Define a region
Get the selection wand with //wand, left-click one corner and right-click the opposite corner. Run //expand vert to cover the full height. Then create the region:
- /rg define spawn: create a region named spawn from the selection
- /rg info spawn: see its owners, members and flags
- /rg addmember spawn <player>: let a builder work inside
The flags that matter
A new region already blocks building for non-members. Add flags for everything else with /rg flag <region> <flag> <allow|deny>:
- pvp deny: no fighting
- mob-spawning deny: no hostile mobs
- creeper-explosion deny and tnt deny: no explosion damage
- use allow: let players press buttons and open doors
- chest-access deny: lock containers
- greeting and farewell: messages on entering and leaving
Priorities and overlapping regions
When regions overlap, the one with the higher priority wins. Make the spawn region priority 10 and a shop inside it priority 20 with its own flags: /rg setpriority shop 20. Child regions can also inherit from a parent with /rg setparent.
The global region
Each world has a __global__ region that covers everything outside other regions. Set flags there to change the default for the whole world, for example /rg flag __global__ pvp deny for a peaceful world. Be careful with the build flag on __global__, which can stop everyone building everywhere.