Basic Intro to Claiming Land:
More configuration options:
Regions can have flags set upon it. Some uses of flags include:
- Blocking player versus combat with the
- Denying entry to a region using the
- Disabling the melting of snow using the
- Blocking players within the region from receiving chat using the
- Halting the growth of vines by using the
A region can have several different flags set at one time, although a certain flag can only have one value at a time. Flags are defined using the
/region flag command, as illustrated below for the “spawn” region and “hospital” regions:
/region flag spawn pvp deny /region flag spawn greeting Welcome to spawn! /region flag hospital heal-amount 2
Remove a flag by not specifying a value:
/region flag spawn pvp
List flags by using the “info” command:
/region info spawn
Sometimes, it may be desired for a flag to only apply to a certain group of players rather than everyone that should enter the region. This can be achieved by specifying an additional “region group” when defining the flag, of which there are several options:
- all (everyone)
The group can be specified using the
-g marker as illustrated below:
/region flag spawn -g nonmembers pvp deny
It is not possible to set the same flag to different values for more than one group on the same region. If you need that functionality, consider making several regions.
When there are multiple overlapping regions, a player must be a member of the region on which the flag is set or on one of the region’s child regions (when region inheritance is involved). This is explained further in Priority and Inheritance.
The entry and exit flags default to “non-member”, meaning setting them to “deny” will prevent non-members from entering/exiting the region. The teleport and spawn location flags default to “members”, which means that only members can take advantage of them by default. All other flags provided by WorldGuard default to “everyone”.
Types of Flags
Each flag is of a certain type that determines what kind of values it may take. For example, the heal-amount flag is an numeric flag, so you can only set numeric values for it.
|Type||Kind of values|
|state||Either ‘allow’ or ‘deny’ (explained later)|
|string||Any form of text|
|integer||A number that does not have decimals (5, but not 5.5)|
|double||Numbers that may have decimals (5, 5.5, 2.425)|
|location||A location in a world|
|boolean||True or false|
|set||A list of unique entries|
Internally, there are more types, but it should generally not be of concern.
Sometimes, a certain location may have multiple overlapping regions with different values for the same flag. The following rules are used to determine which values are selected:
- Regions will inherit the value of a flag from its parent, if the region did not have the flag set.
- Higher priority regions will override lower-priority regions.
- The global region is considered like any other region, except it is at the lowest possible priority.
However, it is still possible for there to be conflicting flag values even after that process. Imagine two different regions at the same priority, for example. At that point, the value of the flag is decided differently depending on the type of flag:
- For state flags, if
denyis present, the result is
deny. Otherwise, if
allowis present, then the final value is
- For other flags, the result is not defined. For that reason, do not, for example, set two different greeting messages in the same area with the same priority.
If a flag is not defined at all, then the default behavior is whichever is most sensible. For example, if “item pickup” is not defined, WorldGuard defaults to allowing it.
Flags are broken down into categories below.
This flag is short for ‘passthrough build’. It has nothing to do with movement.
Where does the flag come into use?
Mobs, Fire, and Explosions
|creeper-explosion||state||Whether creepers can do damage|
|enderdragon-block-damage||state||Whether enderdragons can do block damage|
|ghast-fireball||state||Whether ghast fireballs can do damage|
|other-explosion||state||Whether explosions can do damage|
|fire-spread||state||Whether fire can spread|
|enderman-grief||state||Whether endermen will grief|
|mob-damage||state||Whether mobs can hurt players|
|mob-spawning||state||Whether mobs can spawn|
|deny-spawn||set of entity types||A list of entity types that cannot spawn|
|entity-painting-destroy||state||Whether non-player entities can destroy paintings|
|entity-item-frame-destroy||state||Whether non-player entities can destroy item frames|
Example: Preventing sheep and cows from spawning at spawn
The entity types must be specified:
/rg flag spawn deny-spawn cow,pig
|lava-fire||state||Whether lava can start fires|
|lightning||state||Whether lightning can strike|
|water-flow||state||Whether water can flow|
|lava-flow||state||Whether lava can flow|
|snow-fall||state||Whether snow will fall|
|snow-melt||state||Whether snow will melt|
|ice-form||state||Whether ice will form|
|ice-melt||state||Whether ice will melt|
|mushroom-growth||state||Whether mushrooms will grow|
|leaf-decay||state||Whether leaves will decay|
|grass-growth||state||Whether grass will grow|
|mycelium-spread||state||Whether mycelium will spread|
|vine-growth||state||Whether vines will grow|
|soil-dry||state||Whether soil will dry|
liquid-flow flags require that the “high frequency flags” option be enabled in the configuration. This is because these events can be very frequent, requiring more region lookups, and potentially slowing down your server (or at least warming the server room a bit more).
|item-pickup||state||Whether items can be picked up|
|item-drop||state||Whether items can be dropped|
|exp-drops||state||Whether XP drops are permitted|
|deny-message||string||The message issued to players that are denied an action|
|entry||state||Whether players can enter the region|
|exit||state||Whether players can exit the region|
|greeting||string||The message that appears upon entering the region|
|farewell||string||The message that appears upon leaving the region|
|enderpearl||state||Whether enderpearls can be used|
|invincible||state||Whether players are invincible|
|game-mode||gamemode||The gamemode (survival, creative, adventure) that will be applied to players that enter the region|
|time-lock||integer||Time of day in ticks (between 0 and 24000) that players will see the world as while in the region. Use + or – for time relative to the world time.|
|weather-lock||weather||Type of weather players will see when in the region. This does not affect world mechanics. Valid values are
|heal-delay||integer||The number of seconds between heals (if
|heal-amount||integer||The amount of half hearts to heal (…or hurt if negative) the player at the rate of
|heal-min-health||double||The minimum number of half hearts that damage (via
|heal-max-health||double||The maximum number of half hearts that healing (via
|feed-delay||integer||See equivalent heal flag, except this is for food|
|feed-amount||integer||See equivalent heal flag, except this is for food|
|feed-min-hunger||integer||See equivalent heal flag, except this is for food|
|feed-max-hunger||integer||See equivalent heal flag, except this is for food|
|teleport||location||The location to teleport to when the
|spawn||location||The location to teleport to when a player dies within the region|
|blocked-cmds||set of strings||A list of commands to block|
|allowed-cmds||set of strings||A list of commands to permit|
The healing, feeding, greeting, and farewell message flags require that the “use player move event” option not be disabled in the configuration.
Example: Changing the message players receive when an action they try is blocked
/rg flag spawn deny-message Sorry! You are at spawn. If you want to find a place to call home, use the rail station to leave spawn.
Example: Blocking the “/tp” and “/teleport” commands at spawn
The commands in question can be blocked with:
/rg flag spawn blocked-cmds /tp,/teleport
Example: Preventing non-members of a “secret_club” region from entering it
The key is to set the region group to “nonmembers”:
/rg flag secret_club entry -g nonmembers deny
Example: In a “hospital” region, heal players one heart every second up to half their health bar
Without any buffs, the player’s maximum health is 20, so 10 is half of that:
/rg flag hospital heal-amount 2 /rg flag hospital heal-max-health 10
|pistons||state||Whether pistons can be used|
|send-chat||state||Whether players can send chat|
|receive-chat||state||Whether players can receive chat|
|potion-splash||state||Whether potions can have splash effects|
|notify-enter||boolean||Whether players with the
|notify-leave||boolean||Whether players with the
|allow-shop||state||Not used by WorldGuard at this time, but third-party plugins may use it|
|buyable||boolean||Not used by WorldGuard at this time, but third-party plugins may use it|
|price||double||Not used by WorldGuard at this time, but third-party plugins may use it|