Hey, I need to use Vault in my plugin but I'm getting NullPointerExcecption error while setting up economy. Method looks like this: Code: public boolean setupEconomy() { if (plugin.getServer().getPluginManager().getPlugin("Vault") == null) { return false; } RegisteredServiceProvider<Economy> rsp = plugin.getServer().getServicesManager().getRegistration(Economy.class); if (rsp == null) { return false; } economy = rsp.getProvider(); return economy != null; } What's wrong with this?
Maybe plugin is null? You can almost always replace the plugin instance with 'Bukkit', e.g. Bukkit.getServer() returns the server singleton.