Reaching back to 2011 and before, WorldGuard, alongside WorldEdit, has become a necessity for any Minecraft server intended to host a decent number of players for all its features, a must-have tool if you’re intending to define regions in your server either for common access or to introduce players to the server

So, what’s WorldGuard?

WorldGuard is a Minecraft plugin that will allow us to define specific regions in our servers and protect them from other players, furthermore, WorldGuard includes a huge number of flags that will allow us to customize the region rules as we seem fit, such as disabling PvP or healing, prevent explosions or any mob from spawning, or even block commands from being used in a specific area, with WorldGuard you can even restrict access on that zone to a certain group of players!

WorldEdit is essential for WorldGuard to work, and WorldGuard is also a dependency for other region management plugins such as ProtectionStones, a user-oriented version for region management which you can learn how to install from our tutorial here!

Installation

  • Go to the official site
  • Download the version corresponding to your Minecraft server version

Once downloaded, you’ll need to upload the file to your server, this can be achieved by doing the following:

  • Access your game panel and stop your server
  • Go to the Files tab and click on the Plugins folder
    • If this folder doesn’t exist, you can create it
  • Locate the file previously downloaded on your computer, drag and drop it into this folder
  • Start your server

WorldGuard is now installed on your server, and a new folder containing WorldGuard configuration files will be generated in your plugins folder

Start using WorldGuard

WorldGuard requires WorldEdit to work, you’ll use the wand from WorldEdit to select the area corresponding to the region you want to create.

With the wand in hand (a wooden axe by default), use the left click to set position 1 and the right click to set position 2. In this example, both points have been represented as an iron block and a diamond block respectively

Usually, you’ll need to extend the selected zone all the way up and down to avoid griefing, so you’ll need to type //expand vert too

Use WorldGuard’s wand

WorldGuard, like WorldEdit, has a tool or wand used on a block to show the region information, this wand is set to a piece of leather by default, but it can be changed in the configuration file.

WorldGuard wand

How to define and delete a region with WorldGuard

Once you’ve selected an area, you can now define a region by using the following command:

/rg define <zone id> <owner/s>

For example, we’re going to create a new region called ‘TestingArea’ in the area previously selected. So we’ll need to run /rg define testingarea, if you don’t specify a user then by default only the server operators will have access to that region

WorldGuard - creating a new region
You will get a message in the chat letting you know that the region is now protected, and the ID assigned to it

So let’s say we want to expand or decrease the region area in the future, how would we do that? simply, just use the rg redefine command:

/rg redefine <zone id>

By using /rg redefine testingarea we’ve updated the area assigned previously, in this case, expanding it.

WorldGuard - redefining a region
You’ll also get a message letting you know the region updated

And if you want to remove the region, you can do so through the rg delete command

/rg delete <zone id>

Typing /rg delete testingarea will remove the region from the world, so we can use the area for a different region or re-create it later

WorldGuard - deleting a region
The area will no longer be protected by WorldGuard and other users may be able to break blocks and build on it

How to add and delete users to a region

You can add users to a region previously created by using the rg addmember command, this will allow users access and building permission on the region.

/rg addmember <zone id> <name>

For example, /rg addmember testingarea Liam will add Liam to the region we previously created called ‘testingarea‘.

WorldGuard - add members to a region

And if you want to remove access to that user you can use the rg removemember command

/rg removemember <zone id> <name>

/rg removemember testingarea Liam will now remove the player Liam from the region.

Wandering trader
Wandering trader spotted

Alternatively, you can use /rg addowner and /rg removeowner instead to let players have full control of the regions.

How to add and delete region flags

Region flags are easily one of the strongest points from Worldguard, limiting the mechanics available based on the region where the player is located. You can see the flags from a region by using the rg flags command

/rg flags <zone id>
WorldGuard - List of flags
These are the flags available in the testingarea region, you can specify the number of the page in the command to see the rest of the flags

The syntax may vary depending on the type of the flag used (state, string…), but the structure is more or less the following

/rg flag <zone id> <flag name> <allow/deny>

Here are a few examples of flags that could be useful for your server

How to restrict PvP in a region

We can use the pvp flag for that, which is a state type and can be set to allow or deny

/rg flag testingarea pvp deny
How to set a greeting message when entering a region

You can set a greeting message that will appear in the chat once you enter or leave the region, since this is a string type of flag you will need to specify the message instead of setting it to allow or deny

/rg flag <zone id> greeting <text>

Other related flags are:
greeting-title: The message will appear on the top of the screen when entering the region

farewell: Message in chat when leaving the region
farewell-title: Message on top of the screen when leaving the region
/rg flag testingarea greeting Entering the Testing Area
WorldGuard - Greeting message when entering the region

These messages are compatible with colors from plugins like EssentialsX Colors, for example:

/rg flag testingarea farewell &4Leaving the Testing Area
WorldGuard - Farewell message after leaving the region
How to deny access/exit to a zone

This is especially useful for a jail function from a plugin like EssentialsX, you can use the entry, exit, exit-via-teleport flags.

/rg flag testingarea entry deny
/rg flag testingarea exit deny
/rg flag testingarea exit-via-teleport deny

You can also use the entry-deny-message and exit-deny-message flags to add a message for users who try to enter or leave a zone.

Useful Commands

Worldguard also comes with a bunch of useful commands not fully covered in this guide, these are:

/rg info <zone id> = Shows information of the specified region, such as the flags, bounds and members
/rg list = Shows a list of all the available regions
/stopfire = Stop all the fire spread in the current world
/allowfire = Reverts the suspension and allow fire to spread again
/slay <player name> = Kill another player
/stack = Automatically organizes your inventory and stack items

Configuration

Like other bukkit plugins, the configuration file for WorldGuard is called config.yml and is located in the WorldGuard folder in the plugins folder

You can reach the official documentation page to see all the available configurations. Some of these are:

Change WorldGuard’s wand

Locate the wand variable in the configuration file and replace the value from ‘minecraft:leather’ to any item of your choice, but make sure it doesn’t conflict with items used by other plugins

Change WorldGuard wand
We’ve changed the wand item to a stick

Allow Non-ops to use WorldGuard

Locate the op-permissions variable and change it from true to false

Change WorldGuard permission
By setting it to false, any user will be able to use WorldGuard

Disable Sand and Gravel Physics

Locate the variables no-physics-gravel and no-physics-sand and replace their values from false to true.

Disable
This will make Sand and Gravel not fall when placed in the air

Permissions

WorldGuard comes with its own set of permissions that can be assigned to a player with a plugin like LuckPerms. You can reach the official documentation to see all the available permissions

Learn more about Minecraft hosting here at Iceline Hosting