How to install WorldGuard to Your Minecraft Server

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
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!
Once downloaded, you’ll need to upload the file to your server, this can be achieved by doing the following:
WorldGuard is now installed on your server, and a new folder containing WorldGuard configuration files will be generated in your plugins folder
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
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.
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
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.
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
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‘.
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.
Alternatively, you can use /rg addowner and /rg removeowner instead to let players have full control of the regions.
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>
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
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
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
These messages are compatible with colors from plugins like EssentialsX Colors, for example:
/rg flag testingarea farewell &4Leaving the Testing Area
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.
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
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:
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
Locate the op-permissions variable and change it from true to false
Locate the variables no-physics-gravel and no-physics-sand and replace their values from false to true.
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