1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

help get region corners pos 1 , pos 2

Discussion in 'Skript' started by ammar, Dec 25, 2019.

Thread Status:
Not open for further replies.
  1. ammar

    ammar Member

    Joined:
    May 15, 2017
    Messages:
    13
    Likes Received:
    1
    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
     
  2. TheCringleYT

    TheCringleYT Active Member

    Joined:
    Sep 29, 2019
    Messages:
    194
    Likes Received:
    4
    There is a resource called "Regions", use that.
     
  3. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    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.
    --- Double Post Merged, Dec 27, 2019, Original Post Date: Dec 27, 2019 ---
    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
     
  4. ammar

    ammar Member

    Joined:
    May 15, 2017
    Messages:
    13
    Likes Received:
    1
    @TPGamesNL That is awesome thank you
    can you add me on discord

    ammar#0012
     
Thread Status:
Not open for further replies.

Share This Page

Loading...