Check if player is owner of region that he is standing in

Discussion in 'Plugin Development' started by _Shadod, Apr 3, 2024.

  1. Offline

    _Shadod

    Hello dear forum users! I need your help, I'm writing a plugin and I need to check next:

    the player sends a command, and if the player is in the region and this is his region (he is the owner of this region)
    the command will be executed. There is a solution?? please, help!
     
  2. Online

    timtower Administrator Administrator Moderator

  3. Offline

    _Shadod

    thanks, but, how i can check the region that players standing in,seems, find rg by playerLocation, if PlayerLocation in borders of rg, then command will be executed, to check owners of him??
     
  4. Online

    timtower Administrator Administrator Moderator

    region.contains(BlockVector3.at(20, 0, 30));
    Can probably do the same thing with a player location.

    https://worldguard.enginehub.org/en/latest/developer/regions/spatial-queries/
     
  5. Offline

    _Shadod

    Thx, I'll test it tomorrow on evening
     
  6. Offline

    _Shadod

    bruh, I don’t quite understand how to use it, can you give me an example??
    i have found instruction, but i get red line
    Location loc = new Location(((Player) sender).getWorld(), 10, 64, 100);
    RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
    RegionQuery query = container.createQuery();
    ApplicableRegionSet set = query.getApplicableRegions(loc);
    i get under (loc);
     
  7. Online

    timtower Administrator Administrator Moderator

    @_Shadod Hover your mouse over the error, it will tell you what is wrong.
     
  8. Offline

    _Shadod

    getApplicableRegions(com.sk89q.worldedit.util.Location) in RegionQuery cannot be applied to (org.bukkit.Location)
     
  9. Online

    timtower Administrator Administrator Moderator

  10. Offline

    _Shadod

    thx, i have tested it, it says that there is no method called "BukkitAdapter", and there is no class to import
     

Share This Page