Getting Regions - SkriptLang/skript-worldguard GitHub Wiki
skript-worldguard provides multiple ways to access regions. On this page, we will cover each method.
All Regions in a World
The first method is to obtain all of the regions in a world. The syntax for doing so is:
[all [[of] the]|the] [worldguard] regions [(in|of) %worlds%]
The world
expression is optional, meaning it will use the default world available.
For a player executing a command, this is the world they are currently in.
This expression is useful for filtering for a specific kind of region. Consider the following example to obtain all of the global regions on a server:
all regions of all worlds where [input is a global region]
Specific Region in a World
For more specific searches, the second method is to obtain a region with a specific name in a world. The syntax for doing so is:
[the] [worldguard] region[s] [named] %strings% [(in|of) %world%]
[the] [worldguard] region[s] with [the] (name[s]|id[s]) %strings% [(in|of) %world%]
Just like above, the world
expression is optional, meaning it will use the default world available.
To provide an example, consider the following expression:
the region named "heart" in the player's world
Regions at a Location
Finally, the third method is to obtain all of the regions at a specific location. The syntax for doing so is:
[the] regions %direction% %locations%
It takes in both a direction and a location.
To provide some examples, consider the following expressions:
# if the player is in any regions
the regions at the player
# if the player is standing directly on top of any regions (i.e., the block below their feet is in a region)
the regions below the player