TogetherFreaksDREI

Untitled

Nov 27th, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. package tgdrei;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.command.Command;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9. import org.bukkit.potion.PotionEffect;
  10. import org.bukkit.potion.PotionEffectType;
  11.  
  12. public class tgdreiprogrammieren extends JavaPlugin {
  13. public void onEnable () {
  14. loadConfig();
  15. System.out.println("[tgdrei] started succesful!");
  16. }
  17. public void onDisable () {
  18. System.out.println("[tgdrei] stopped succesful!");
  19. }
  20. public boolean onCommand(CommandSender sender, Command cmd, String cmdLabel, String [] args) {
  21. //heal
  22. Player p = (Player) sender;
  23. if (cmd.getName().equalsIgnoreCase("heal")) {
  24. if (p.hasPermission("tgdrei.heal")) {
  25. if(args.length == 0) {
  26. p.sendMessage("ยงaYou were succesfull healed!");
  27. p.setHealth(20);
  28. p.setFoodLevel(20);
  29. }
  30. if (args.length == 1) {
  31. Player p2 = getServer().getPlayer(args[0]);
  32. p2.setHealth(20);
  33. p2.setFoodLevel(20);
  34. p.sendMessage(ChatColor.GREEN + p2.getName() + " ยงawas succesfull healed");
  35. p2.sendMessage(" ยงaYou were healed by" + ChatColor.GREEN + p2.getName());
  36.  
  37. //Superwalk
  38. }
  39.  
  40. }
  41. return true;
  42. }
  43. else {
  44. return false;
  45. }
  46. if (cmd.getName().equalsIgnoreCase("superwalk")) {
  47. if (p.hasPermission("tgdrei.superwalk")) {
  48. if (args.length == 0);
  49. p.sendMessage("You activited Superwalk succesful. Type /superwalkoff to stop it.");
  50. p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 99999, 127));
  51. }
  52. //Superwalk remove
  53. if (cmd.getName().equalsIgnoreCase("superwalkoff")) {
  54. if (p.hasPermission("tgdrei.superwalkoff")) {
  55. if (args.length == 0);
  56. p.sendMessage("You deactivited Superwalk succesful. Type /superwalk to turn it on.");
  57. for (PotionEffect effect : p.getActivePotionEffects()) {
  58. p.removePotionEffect(effect.getType());
  59. }
  60. }
  61. }
  62. }
  63.  
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment