WorldGuard - Get a Flag with a location

Discussion in 'Plugin Development' started by pollag, Dec 1, 2012.

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

    pollag

    Hello,
    I would like to know how I can get a flag with a location, a block or a player.
    I tested that, but it does work !

    ''<MyPluginName>.getWorldGuard().getRegionManager(e.getBlock().getWorld()).getApplicableRegions(e.getBlock().getLocation()).getFlag("<MyFlagName>", (LocalPlayer) e.getPlayer())"

    I would like to recover a bollean to kown if the people can breack a block or not.

    Pollag

    Please

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

    leiger

    Then you will want to look at whether the player has permission to build in that region, not which flags are attached.
     
  3. Offline

    Gildan27

    Code:
    WorldGuardPlugin worldGuardPlugin = (WorldGuardPlugin) Bukkit.getServer().getPluginManager().getPlugin("WorldGuard");
    boolean canBreak = worldGuardPlugin.canBuild(e.getPlayer(), e.getBlock());
    
     
  4. Offline

    pollag

    thanks
     
Thread Status:
Not open for further replies.

Share This Page