-
-
Notifications
You must be signed in to change notification settings - Fork 6
Region Properties
skript-worldguard includes additional syntax for other properties of regions. On this page, the rest of the available syntax will be briefly covered.
For simplicity, a condition is available that checks whether a player can build at a location or in a region. This condition considers factors such as flags, membership, and permission bypasses. The syntax for this condition is:
%players% (is|are) allowed to build (%directions% %locations%|[in] %worldguardregions%)
%players% (is not|isn't|are not|aren't) allowed to build (%directions% %locations%|[in] %worldguardregions%)
%players% can build (%-directions% %-locations%|[in] %-worldguardregions%)
%players% (can not|cannot|can't) build (%-directions% %-locations%|[in] %-worldguardregions%)
Consider this example of a setblock
command that considers whether the user can build at the targeted location.
command /setblock <material>:
description: Sets your targeted block to a different type.
trigger:
if the player cannot build at the targeted block:
message "<red>You do not have permission to modify your targeted block!"
else:
set the targeted block to the material-argument
An expression is available to obtain all the blocks of a region:
blocks of %worldguardregions%
%worldguardregions%'[s] blocks
Consider this example command that fills in a region with a material (like /fill
for a region):
command /fillregion <text> <material>:
trigger:
set {_region} to the region text-argument in the player's world
set the blocks of {_region} to material-argument
An expression is available to obtain the minimum point, maximum point, and all points of a region:
(min|:max)[imum] point[s] of %worldguardregions%
%worldguardregions%'[s] (min|:max)[imum] point[s]
points of %worldguardregions%
%worldguardregions%'[s] points
Consider this example that highlights the points of a region by setting them to red wool.
command /highlight-points <text>:
trigger:
set the blocks at the points of the region text-argument to red wool
A region is temporary/transient if it is removed when the server restarts. A condition exists for checking whether a region is temporary:
%worldguardregions% (is|are) (temporary|transient)
%worldguardregions% (is not|isn't|are not|aren't) (temporary|transient)
Consider this example where a message is sent to a player when they enter a temporary region:
on region enter:
if the region is temporary:
message "Be ready! This protected region will expire when the server restarts."
A region is one of three types: global
, cuboid
, or polygonal
.
A condition exists for checking the type of a region:
%worldguardregions% (is|are) [a] (global|cuboid[s]|polygon[s|al]) [region[s]]
%worldguardregions% (is not|isn't|are not|aren't) [a] (global|cuboid[s]|polygon[s|al]) [region[s]]
Consider this example where a message is sent to a player when they enter a polygonal region:
on region enter:
if the region is polygonal:
message "Welcome to my wacky region!"
Regions are integrated with Skript's 'contains' condition, meaning you can check whether a region contains a location, block, chunk, etc.
Consider this example:
command /playersinregion <text>:
trigger:
set {_region} to the region text-argument
loop all players:
if {_region} contains loop-player:
send "%loop-player% is in %{_region}%"
Have ideas for new features? You can click here to open a new discussion.