DGuard

WorldGuard: regions, flags and priorities

WorldGuard protects areas an admin has selected and changes the rules inside them: outsiders can't build, PvP is off at spawn, mobs stay out of the market, a restricted area can't be entered. It works with WorldEdit: you select the area with WorldEdit, and WorldGuard turns it into a region.

The DGuard team8 min read

In short: install WorldEdit and WorldGuard, get the axe with //wand, mark two corners and create a region with /rg define spawn. In a new region only members can build — add them with /rg addmember. Rules such as PvP are set with flags: /rg flag spawn pvp deny. Where regions overlap, priorities decide, and the whole world has the __global__ region.

Installation and permissions

  1. 1

    Install WorldEdit

    WorldGuard needs the Bukkit version of WorldEdit. Both run on server software with the Bukkit API — Spigot and Paper; the vanilla server, Forge and Sponge won't do. The editor itself is covered in WorldEdit.

  2. 2

    Download WorldGuard for your version

    WorldGuard builds are tied to the Minecraft version: on Modrinth, for example, 7.0.17 is marked for 1.21.11 and 26.1–26.2, while 7.0.20 is for 26.3 only. Take the build that lists your server's version.

  3. 3

    Put it in plugins/ and restart

    After startup check the log for errors. The routine is the same for every plugin — how to install a plugin.

  4. 4

    Grant permissions

    By default nobody but operators can use WorldGuard. Give admins worldguard.*, and everyone else specific nodes such as worldguard.region.define or worldguard.region.info.* through LuckPerms.

Creating a region

  1. 1

    Select the area

    //wand gives you a wooden axe: left-click a block for the first corner, right-click for the second. A region can be a cuboid or a polygon with height (//sel poly); WorldGuard won't accept a cylinder. To make the region run from bedrock to the sky, expand the selection with //expand vert.

  2. 2

    Create the region

    /rg define spawn (or /region define). The name is unique within the world and case-insensitive. A new region immediately stops everyone who isn't in it from building.

  3. 3

    Add people

    /rg addmember spawn g:builders adds the builders permission group, /rg addowner spawn Steve adds an owner. Owners can be listed right away: /rg define spawn Steve.

  4. 4

    Set flags

    /rg flag spawn pvp deny. Remove a flag with the same command and no value: /rg flag spawn pvp.

Changes save on their own after a short delay, in the background and without pausing the server; to force it, /rg save. Members and owners build the same way; the difference is in command permissions: you can let owners, for example, add people to their own region (worldguard.region.addmember.own.*) but not members. A permission group is written with the g: prefix.

Flags worth setting

FlagTypeWhat it does
pvpallow/denyCombat between players
mob-spawningallow/denyMob spawning, including from spawn eggs and commands
deny-spawnlistBlocks specific mobs: /rg flag spawn deny-spawn zombie,creeper
entry / exitallow/denyEntering and leaving the region; by default applies to non-members
greeting / farewelltextA chat message on entering and leaving
invincibleallow/denyPlayers can't be hurt in the region
fall-damageallow/denyFall damage
enderpearlallow/denyUsing ender pearls
blocked-cmdslistCommands blocked in the region
item-drop / item-pickupallow/denyDropping and picking up items
game-modegame modeThe game mode applied to players who enter
passthroughallow/denyallow makes the region transparent to building: it sets flags but doesn't protect
The full list and defaults: /rg flags <region> in game or the Region Flags page of the docs

A flag can apply to some players only, through a region group: /rg flag spawn -g nonmembers pvp deny. The groups are all, members, owners, nonmembers, nonowners; they're region membership, not permission groups. Flags against fire, lava and explosions are covered in grief protection.

An arena inside spawn: fighting is allowed, building works as at spawn
/rg define arena
/rg flag arena pvp allow
/rg flag arena passthrough allow

Overlaps, priorities and inheritance

  • Without priorities, where regions overlap a player must be a member of all of them to build.
  • Priority defaults to 0 and can be negative. For building, only the highest-priority regions count; for flags, the highest-priority region that has the flag set wins: /rg setpriority pub 10.
  • A tie. If regions with the same priority set different allow/deny values, deny wins. For text flags the result is undefined — don't set two greetings in one spot.
  • Inheritance. /rg setparent plot1 mall — the child gets the parent's members and owners, and its flags where the child has none. A region has at most one parent, and the parent's priority shouldn't be higher than its children's.
  • Templates. /rg define -g plot_template creates a region with no physical area — a handy shared parent for similar plots.

The __global__ region

Every world has __global__, a world-wide region at the lowest priority. It appears the first time you change it: /rg flag __global__ pvp deny turns PvP off everywhere except regions that set the flag otherwise. By default it doesn't protect the world: it implicitly has passthrough allow.

  • Stop building in the wilderness: /rg flag __global__ passthrough deny. Then players can only build where they're region members.
  • Don't set `build` on the global region. The docs strongly advise against it: build deny stops every piston in the world outside other regions.
  • Members of the global region. Adding them implicitly sets passthrough deny.

Handy commands

CommandWhat it does
/rg info [region]Details of a region, or of the one you're standing in
/rg list [-p name]A list of regions, including a player's regions
/rg flags <region>An interactive flag list: click a value to change it
/rg select <region>Select the region in WorldEdit
/rg redefine <region>Replace the region's area with your current selection
/rg remove <region>Delete a region (with children — the -f or -u flag)
/rg setpriority, /rg setparentPriority and parent
Almost everything works from the console too — with -w <world>

Regions are stored in YAML files, which are easy to back up with the world. The developers strongly advise against MySQL storage and plan to remove it. Backups are covered in server backups.

WorldGuard and the anticheat

Regions decide where fighting and building are allowed; the anticheat decides whether it's fair. pvp deny turns combat off at spawn but doesn't stop Fly and Speed from reaching other people's bases, and in an arena with pvp allow a player with KillAura or Reach is perfectly fine as far as WorldGuard is concerned. Area protection and cheat detection are different plugins, and one doesn't replace the other.

DGuard — the best anticheat for a modern Minecraft server — works the same in every region and checks combat, movement, packets, inventory, building and the world. In a comparison of 47 cheat types DGuard has a check for each; the nearest rival, Intave, has 27. Every rival mark is checked against their code and docs — see the comparison.

FAQ

How do I create a region in WorldGuard?

Select the area with the WorldEdit axe (//wand, left and right click on the corners) and run /rg define <name>. Only members can build in the region; add them with /rg addmember.

Why doesn't my WorldGuard region protect anything?

Most likely you're testing as op or with all permissions: those implicitly bypass protection. Test from a regular account, and check that the region doesn't have passthrough allow.

How do I turn off PvP at spawn?

/rg flag spawn pvp deny. To turn PvP off in the whole world, set the flag on __global__, and pvp allow with a higher priority on arenas.

Can I use WorldGuard without WorldEdit?

No. WorldGuard requires the Bukkit version of WorldEdit: that's what you select region areas with.

How do I block building everywhere except regions?

/rg flag __global__ passthrough deny. The docs advise against the build flag on the global region: it stops pistons all over the world.

Sources

All sections

Run the best anticheat for modern Minecraft

DGuard catches all 47 kinds of cheats in our comparison — the closest rival, Intave, has 27. Full protection on every plan, free up to 30 players online.