help get region corners pos 1 , pos 2

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ammar

Member
May 15, 2017
13
1
0
32
hello
i just need help get the region corners pos 1 , pos 2
example

region at block at event-block get the region name

what i want is pos 2 of region at block at event-block

its fine if using skript-mirror
 
There is a resource called "Regions", use that.
They probably don't want that, since WorldGuard is supported by many plugins, and I doubt that any plugins will add support for some script.
[doublepost=1577444082,1577441331][/doublepost]
hello
i just need help get the region corners pos 1 , pos 2
example

region at block at event-block get the region name

what i want is pos 2 of region at block at event-block

its fine if using skript-mirror
You can indeed use skript-mirror for this. Let's say you have a region saved in `{_region}`. To convert it to an actual WorldGuard region, you can use `{_region}.region` (or with an exclamation mark if you have skript-mirror 1.x). Then you use `{_wgregion}.getPoints()` (where `{_wgregion}` is your WorldGuard region) to get 4 vectors (class com.sk89q.worldedit.math.BlockVector2, 1 vector per corner). Convert this to a Vector3 (`BlockVector2#toVector3()` will convert it to a Vector3 with y=0). Then you can use `BukkitAdapter#adapt(World, Vector3)` (com.sk89q.worldedit.bukkit.BukkitAdapter) to convert it to an actual Bukkit (/ Skript) location
 
Status
Not open for further replies.