Worldguard

From The Outpost
Jump to: navigation, search

Regions in WorldGuard allow you to define rules for and protect certain areas.

This page covers most of the basics, but a more in depth guide can be found on the official Worldguard documentation website: http://docs.enginehub.org/manual/worldguard/latest/

Introduction

Regions:

  • Have a list of owners that can edit in the region
  • Have a list of members that can build in the region
  • May have a parent region and a priority
  • Can have flags to disable certain features (such as PvP)

Regions protect building and breaking blocks by default, and can have flags that disable other actions such as using doors, placing vehicles, and so on.


Selecting regions

Regions are selected using WorldEdit.

Unfamiliar with WorldEdit?

  1. Give the worldedit.selection.* permission to allow users to select areas.
  2. With the wooden axe, left and right click blocks to set a cuboid's first and second point.
  3. Use Template:Cmd to make the area 10 units larger upwards and 15 units larger downwards.

If you want to make the selection extend between sky and bedrock, use Template:Cmd.

Check out the help for WorldEdit. WorldEdit has the most powerful cuboid and polygonal selection and manipulation tools of any plugin or mod in Minecraft and so you should become familiar with it!

Commands

Permission must be given for /region for users to be able to use these commands. See the the permissions page for a list of these permissions.

Defining regions

This defines a new protected region. You can enter a list of owners that will be able to build in this area. To specify a player, just enter their name for player. To specify groups, put 'g:' in front of the group name. Re-defining an area will clear all of its information. To add members, use /region addmember (see below).

Note Note:

Claiming regions

Allows a regular user to claim a plot of land and be set as its areas owner. Users can only claim areas that don't overlap other people's areas and they cannot replace another existing area that they don't own. They redefine areas they own with this command. Re-claiming an existing owned area will clear its owner list.

Setting a region's flags

Main article: Region Flags

The regions list will be written to file when a flag is changed.

The region "__global__" is a master region. Apply flags to it, and it will be the default.

State flags

Set a flag on an existing region.

  • A flag with none as its state means that it will have the default behavior.
  • allow explicitly allows the behavior.
  • deny explicitly denies the behavior.
  • deny takes precedence over allow, and allow takes precedence over none.
  • All regions start off with none for all of its flags when first created.

For example, if two regions overlap, if one of those two regions has deny for its build flag, then no one will be able to build at all. If one of those regions has allow for its build flag and the other does not have deny, then anyone can build in the region.

Setting a region's parent

Set a region's parent to another region. Not providing a parent clears the specified region's parent.

Deleting a region

Removes a region. The regions list will be written to file.

If the region has children, all the children will be removed.

Getting information about a region

Lists information about a region.

Adding owners and members

Add owners or members to an existing region. You can specify both players and groups just like in the /region define command. The regions list will be written to file.

/region addowner jonpagoda jit erich g:members

Listing regions

Prints a list of regions.

Saving the list of regions

Save the list of protected regions to file. Every time you add, remove, or edit a protected region, the changes are automatically saved so you rarely need to use this command.

Loading the list of regions

Load the list of protected regions from file. You only need to use this command if you edited the protected regions file out-of-game and now need to reload it without restarting the server.

Region wand

You can use leather and right click a block to see a list of regions that encompass this. You can change the wand item by modifying WorldGuard's configuration.

Tutorial

Allowing only "Jon" and "Tetsu" to work on a pagoda

The name of this region will be pagoda.

  1. Select the region with WorldEdit.
  2. Type in Template:Cmd.
  3. You're done!

Now Zhyk wants to join in? Don't want him as a region owner? Use Template:Cmd

Allowing players to build inside plots inside a protected city

  1. Select the city's region with WorldEdit.
  2. Create a region for it with Template:Cmd.
  3. For Alex, who is a resident of the city, select the region for his plot.
  4. Create a region for it with Template:Cmd.
  5. Make Alex's region higher priority than the city's region in order for access to work out properly by using Template:Cmd. If you do not do this, Alex would need build access in both his plot and the city plot.
  6. You're done!

Allowing specific groups as owners of an area

  1. Select the city's region with WorldEdit.
  2. Create a region for it with Template:Cmd.
  3. You're done!

Database Format / External Tools

See the database format article.

Flag List

Flag Description Default Type
passthrough Use allow to have this region treated as a region that doesn't check build permission (use this to make simple no-PVP, etc. zones). N/A State
build All members and owners will be able to build normally without changing this flag, do not change it. This flag overrides all region build checks. Deny always takes precedence over allow. If you simply want to protect a region, you don't have to touch this flag. By default no one can build in a region until you use addowner/addmember to add a player to the region. N/A State
construct Don't use this flag at all. It's broken and should be considered deprecated. Members Group
pvp Allow or block PvP. Allowed State
mob-damage Allow or block mob damage on players. Allowed State
entity-item-frame-destroy Allow or block non-player entities from destroying item-frames. Allowed State
entity-painting-destroy Allow or block non-player entities from destroying paintings. Allowed State
mob-spawning Allow or deny mobs spawning Allowed State
creeper-explosion Allow or block creeper damage to terrain and players. Allowed State
enderman-grief Allow or prevent endermen from picking up or placing blocks. Allowed State
interact Allow or prevent players from interacting with redstone, chests, etc. Deny State
enderpearl Allow or prevent players from teleporting to or from regions using enderpearls. Allowed State
enderdragon-block-damage Allow or prevent enderdragon damage to blocks. Allowed State
ghast-fireball Allow or block fireballs damage to terrain and players. Allowed State
sleep Allow or block players from entering beds. Allowed State
tnt Allow or block TNT. Allowed State
lighter Allow or block flint and steel. Allowed State
fire-spread Allow or block the spread of fire (requires high frequency flags to be on in configuration) Allowed State
lava-fire Allow or block whether lava can start fires (requires high frequency flags to be on in configuration) Allowed State
lightning Allow or block lightning striking at all in a region Allowed State
chest-access Allow or block the player from opening chests, furnaces, and other containers in a region Deny State
pistons Allow or block piston activation Allowed State
water-flow Allow or block flow of water. (requires high frequency flags to be on in configuration) Allowed State
lava-flow Allow or block flow of lava. (requires high frequency flags to be on in configuration) Allowed State
use Allow or block the ability to use doors, buttons, pressure plates, levers, etc Allowed State
vehicle-place Allow or block the ability to place vehicles Denied State
vehicle-destroy Allow or block the ability to remove vehicles Denied State
snow-fall Allow or block snow from forming in an area. Note that this will not block weather altogether, that can be done in the config. Allowed State
snow-melt Allow or block snow from melting in an area. Allowed State
ice-form Allow or block ice from forming in an area. Allowed State
ice-melt Allow or block ice from melting in an area. Allowed State
leaf-decay Allow or block leaves from decaying. Allowed State
grass-growth Allow or block grass from spreading to dirt. Allowed State
invincible Sets a temporary godmode on the player. This will also disable /god-mode if set to deny, unless the player has the worldguard.god.override-regions permission. None State
entry Allow or deny a group of players to enter an area Allowed State
entry group Set the group to be considered when checking if a player is allowed entry. See group flag type for more info. Non-members Group
exit Allow or deny a group of players to leave an area Allowed State
exit group Set the group to be considered when checking if a player is allowed to leave. See group flag type for more info. Non-members Group
greeting Message to show a player when they enter a region. See String flag below for formatting. unset String
farewell Message to show a player when they leave a region. See String flag below for formatting. unset String
notify-enter Sends a message to players with the worldguard.notify permission when a player enters a region. False Boolean
notify-leave Sends a message to players with the worldguard.notify permission when a player leaves a region. False Boolean
deny-spawn Set mobs that can't spawn within the region. From console or ingame: /region flag [id] denyspawn Skeleton,Zombie,Creeper,etc . In config file: deny-spawn: [SKELETON, CREEPER, ZOMBIE, ETC] unset List
heal-delay Set the time in seconds between heal-amount triggering unset Integer
heal-amount Set the amount per heal time (see heal-delay) unset Integer
heal-min-health Minimum health the heal flags will drop a player to. unset Integer
heal-max-health Maximum health the heal flags will raise a player to. (a full bar is 20 hearts) unset Integer
feed-delay Set the time in seconds between feed-amount triggering unset Integer
feed-amount Set the amount per hunger regen time (see feed-delay) unset Integer
feed-min-hunger Minimum hunger the feed flags will drop a player to. unset Integer
feed-max-hunger Maximum hunger the feed flags will raise a player to. (a full bar is 20 food) unset Integer
teleport Defines the location /region teleport <id> teleports you to. unset Location
spawn Define the spawn of the region, use /region flag region x y z unset Location
buyable NOT YET IMPLEMENTED False Boolean
price NOT YET IMPLEMENTED unset Double
blocked-cmds Sets the commands that will be blocked inside the region unset List
allowed-cmds Sets the commands allowed in the region. If this is set (not empty) it will act like a whitelist and ONLY commands from this list will be allowed. unset List
send-chat Sets whether or not a player can send chat inside the region unset Boolean
receive-chat Sets whether or not a player can receive chat inside the region. unset Boolean
game-mode Sets the gamemode when a player enters a region. Can either be SURVIVAL, CREATIVE or ADVENTURE. unset Custom
potion-splash Allow or block splash effect from potion Allowed State

Types

State

This type of flag has three states: allow, none, and deny. allow will allow the event to happen in the region, deny will disallow the event to happen, and none will use the default behavior as if there was no region.

Note that the build flag is unique. If set to none (which it is by default) only members of the region can build.

String

This can be set to any arbitrary text. Note that if it is unset, it will usually disable the flag.

Some strings support color formatting, such as the greeting and farewell flags. The following color codes are used in WorldGuard:

Color code Color on white Color on black
&r red red
&R dark red dark red
&y yellow yellow
&Y dark yellow (gold) dark yellow (gold)
&g green green
&G dark green dark green
&c cyan/aqua cyan/aqua
&C dark cyan/aqua dark cyan/aqua
&b blue blue
&B dark blue dark blue
&p purple/pink purple/pink
&P dark purple dark purple
&0 black black
&1 dark grey dark grey
&2 light grey light grey
&w white white

List

This flag can be set to a list of strings. Input values should be comma separated.

Integer

This flag can be any number, negative or positive, that does not have a fraction or decimal portion.

Double

This flag is like an integer, but accepts decimals.

Boolean

This flag can be either true or false. It differs from state flags in that it does not have a default position (none) to fall to.

Location

This flag represents a location. It consists of an x, y, and z coordinate. It can also be "here" for your current location or "none" to unset the flag.

Group

This does NOT refer to a permission group. It refers to region members/owners.

See below for an example on how to set up entry/exit flags.

This flag can be set to any of the following: members, nonmembers, owners, nonowners, or everyone.

If editing regions.yml directly, the values are: MEMBERS, NON_MEMBERS, OWNERS, NON_OWNERS, or ALL.

Give each group the permission "group.<groupname>" if group-owners and group-members are not working. I.e. The group "citizen" gets the permission group.citizen, and can be added as owner/member of regions as g:citizen.

It is also important to note:

If entry, exit, or construct are set to allow, it will allow ALL.

Child regions inherit Parent region Owners and Members, regardless of priority.

Example:

/rg flag <region_ID> entry deny

/rg flag <region_ID> entry -g nonmembers

Deny entry to anyone who is not a member (or owner).


/rg flag <region_ID> exit deny

/rg flag <region_ID> exit -g nonowners

Deny exit to anyone who is not an owner.


/rg addmember <region_ID> g:Builder

/rg addowner <region_ID> g:VIP

Add the "Builder" group to members and the "VIP" group to owners.


Thus, only Builders and VIPs would be able to enter, and only VIPs would be able to exit. All other groups would be denied entry.