Hello, I want to code a function that when a player type /claim he claims a new region by his name. How can I make a new region via WG API? THX a lot!
First you must connect the WorldGuard.jar to your plugin.jar while you code. If u don't know how send me a PM. Second step: Write "depend: [WorldGuard]" into your plugin.yml file. Third step: You can get the WorldGuard API this way: Code:java private WorldGuardPlugin getWorldGuard() { Plugin plugin = getServer().getPluginManager().getPlugin("WorldGuard"); // WorldGuard may not be loaded if (plugin == null || !(plugin instanceof WorldGuardPlugin)) { return null; // Maybe you want throw an exception instead } return (WorldGuardPlugin) plugin;} You can store it in a WorldGuardPlugin varriable and use it later on. Like: Code:java WorldGuardPlugin wg = getWorldGuard(); wg.X.Y(); //> use its methods this way.