Solved Get Random Location Within WorldGuard Region

Discussion in 'Plugin Development' started by PogoStick29, Jul 1, 2013.

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

    PogoStick29

    How can I get a random location within a WorldGuard location? I need a method that takes a String (region name), gets the region (I can do this), then returns a location within the region (as long as the location is not a block; I can fix this).
     
  2. Offline

    skore87

    I am not familiar with WG's API but I'm willing to bet if they give access to the region then the region has the two locations that define it. If that is true then you would decide a random X and Z then determine an appropriate Y coordinate.

    Random
     
  3. Offline

    PogoStick29

    I'll give it a try, thanks!

    I gave it a try but I'm not sure how I would go about doing it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 2, 2016
  4. Offline

    bennie3211

    Cant u get the coords from the region u want. And then just tp the player?
     
  5. Offline

    PogoStick29

    I can get the minimum and maximum bounds from that region, but I need to get a random point within these boundaries. BTW, I'm not teleporting a player ;)
     
  6. Offline

    bennie3211

    Why dont you use a while statement and for x, y and z. And let it be random between the x min and x max, y min and y max, z min and z max? After that you can check if there is a block on that coord
     
  7. Offline

    PogoStick29

  8. Offline

    skore87

    I can't believe you actually posted on there on how to make a random, lol.
     
Thread Status:
Not open for further replies.

Share This Page