Advertisement
MsGamerHD

Untitled

Jul 23rd, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1.             if(cmd.startsWith("/disable")){
  2.                 e.setCancelled(true);
  3.                 if(args.length == 2){
  4.                     String pluginName = args[1];
  5.  
  6.                     try{
  7.                         Plugin pl = Bukkit.getPluginManager().getPlugin(pluginName);
  8.                         if (pl.isEnabled()) {
  9.                             Bukkit.getPluginManager().disablePlugin(pl);
  10.                             p.sendMessage(pr+"Das Plugin " +hrv+pl.getName()+co+" wurde erfolgreich §cdeaktiviert.");
  11.                         } else {
  12.                             Bukkit.getPluginManager().enablePlugin(pl);
  13.                             p.sendMessage(pr+"Das Plugin " +hrv+pl.getName()+co+" wurde erfolgreich §aaktiviert.");
  14.                         }
  15.                     } catch (NullPointerException d) {
  16.                         p.sendMessage(pr+"Das Plugin "+hrv+pluginName+co+" existiert nicht!");
  17.                     }
  18.                 } else {
  19.                     p.sendMessage(fb+"disable <PluginName> §7[Liste aller Plugins: /plugins]");
  20.                 }
  21.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement