How to check if someone is in a world guard region?!

Discussion in 'Plugin Development' started by HyKurtis, Aug 7, 2015.

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

    HyKurtis

    Hello, I'm making a plugin where you can right click a slime ball and be ascended 10 blocks in the air and then a peice of glass is placed underneath you. Well obviously this means that if a player right clicks this slime at spawn it will place the glass at spawn.

    How do i make it so that this only works if you are not in a world guard region (exluding __global__)
    Here is my code for the slime ball:

    http://hastebin.com/lamarusome.avrasm
     
  2. Offline

    SuperOriginal

    WorldGuard#getRegionManager(world).getApplicableRegionSet(Location)

    That returns a set of all the regions overlapping that location.
     
  3. Offline

    jolbol1

  4. Offline

    HyKurtis

    So once I put the API into the build paths what do I type in the code

    like

    if(player.walkingInRegion("spawn") {

    (SOMETHING LIKE THAT)

    Want i want it to do is not allow players to do what this code does http://hastebin.com/lamarusome.avrasm if they are in any region excluding __global__

    EDIT by Timtower: merged posts
     
    Last edited by a moderator: Aug 7, 2015
  5. Offline

    SuperOriginal

  6. Offline

    HyKurtis

    I've read that link above but there is nothing about checking if they are in a region. Or there is but i don't understand it
     
  7. Offline

    SuperOriginal

  8. Offline

    HyKurtis

    Here, i'll write it in sudo code

    if player is in a region exluding __global__ {
    //run the bounce thing
    else {
    player.sendMessage("You can not use that here");
     
  9. Offline

    SuperOriginal

    You're the one that needs help so I'm not sure why you're telling me that. But the link above gives it to you even with examples...
     
  10. Offline

    HyKurtis

    I mean i need to know the java for it not the pseuo code i can't understand how to do it even after reading the link above
     
Thread Status:
Not open for further replies.

Share This Page