-
-
Notifications
You must be signed in to change notification settings - Fork 6
Region Flags
skript-worldguard provides full control over WorldGuard's region flags with complete type support.
Note
While skript-worldguard supports all vanilla region flags, it is possible that those added by other plugins may not work.
Getting the value of a flag is simple. The syntax for doing so is:
[the] [region] flag %string% of %worldguardregions%
Note
If a flag is not explicitly set on a region, its default value will be returned instead.
Consider the following expressions:
the flag "greeting" of the regions at the player
the flag "feed-max-hunger" of the regions at the player
The returned values will be properly typed. For example, you could perform arithmetic:
set {_region} to the region "my_region" in world "my_world"
set {_number} to the flag "feed-max-hunger" of {_region}
send "The value of the flag 'feed-max-hunger' doubled is %{_number} * 2%"
WorldGuard also supports specifying the type of players (groups) that a flag applies to (click here to read more).
This feature is supported by modifying the group flag of a flag. The syntax for doing so is:
[the] [region] group flag of [the] flag %string% of %worldguardregions%
The value of a region group flag is always a text/string.
Considering one of our examples from above:
the group flag of the flag "greeting" of the regions at the player
In the screenshot above, the group flag for the greeting
flag has not been set, so it returns the default value: all
(meaning it applies to all players).
However, if I use the region flag
command to set the value to something else, say owners
, we can see this value reflected when evaluating the expression again: