Querying ProtectionΒΆ
To query protection, the Flags.BUILD flag can be tested using the methods explained in Flag Calculation.
Warning
Region queries do not check if a player has bypass permissions. Depending on your use case, you may want to check that separately.
boolean canBypass = WorldGuard.getInstance().getPlatform().getSessionManager().hasBypass(player, player.getWorld());