### Create AntiGriefLib instance and check permissions Source: https://github.com/xiao-momi/antigrieflib/blob/main/README.md Create an AntiGriefLib instance on plugin enable with options like ignoreOP, silentLogs, bypassPermission, suppressErrors, and the ability to exclude and register custom compatibility implementations. Then use the test method to check if a player can place a block at a location. ```kotlin // Create a lib instance on plugin enable val antiGrief: AntiGriefLib = AntiGriefLib.builder(javaPlugin) .ignoreOP(true) .silentLogs(false) .bypassPermission("myplugin.bypass") .suppressErrors(false) // remove the default WorldGuard compatibility implementation .exclude(java.util.function.Predicate {p: org.bukkit.plugin.Plugin -> p.name == "WorldGuard"}) // register your own custom WorldGuard implementation, so you can use custom flags .register(MyCustomWorldGuardCompatibility()) .build() // use the api to check permissions if (!antiGrief.test(player, Flag.PLACE, location)) { player.sendMessage(Component.text("You can't place it here!")) } ``` -------------------------------- ### Add antigrieflib dependency with Gradle (kts) Source: https://github.com/xiao-momi/antigrieflib/blob/main/README.md Add the Momirealms repository and the antigrieflib dependency to your Gradle Kotlin DSL build file. Replace {VERSION} with the version from gradle.properties. ```kotlin repositories { maven("https://repo.momirealms.net/releases/") } ``` ```kotlin dependencies { implementation("net.momirealms:antigrieflib:{VERSION}") // check the version in gradle.properties } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.