Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. package me.MyBakedTurtle;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.GameMode;
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandSender;
  8. import org.bukkit.entity.Player;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10. import org.bukkit.potion.PotionEffect;
  11. import org.bukkit.potion.PotionEffectType;
  12.  
  13. public class PluginMain extends JavaPlugin {
  14.  
  15. public void onEnable() {
  16. getLogger().info("Plugin successfully enabled!");
  17.  
  18. }
  19.  
  20. public void onDisable() {
  21.  
  22. }
  23.  
  24. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  25. Player player = (Player) sender;
  26.  
  27. if(cmd .getName().equalsIgnoreCase("Fast")) {
  28. player.sendMessage(ChatColor.GREEN + "Fast mode activated!");
  29. player.removePotionEffect(PotionEffectType.SLOW);
  30. player.removePotionEffect(PotionEffectType.JUMP);
  31. player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 2000, 3));
  32. return true;
  33. }
  34.  
  35. if(cmd.getName().equalsIgnoreCase("Slow")) {
  36. player.sendMessage(ChatColor.RED + "You have gained 500 pounds!");
  37. player.removePotionEffect(PotionEffectType.SPEED);
  38. player.removePotionEffect(PotionEffectType.JUMP);
  39. player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 2000, 3));
  40. }
  41.  
  42. if(cmd.getName().equalsIgnoreCase("Suicide")) {
  43. player.setGameMode(GameMode.SURVIVAL);
  44. player.addPotionEffect(new PotionEffect(PotionEffectType.HARM, 2000, 10));
  45. Bukkit.broadcastMessage(ChatColor.RED + player.getName() + " has, died today :/" );
  46. }
  47.  
  48. if(cmd.getName().equalsIgnoreCase("High")) {
  49. player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 2000, 1));
  50. player.sendMessage(ChatColor.GOLD + player.getName() + " Nice Jordans bro!");
  51. player.removePotionEffect(PotionEffectType.SLOW);
  52. player.removePotionEffect(PotionEffectType.SPEED);
  53. }
  54.  
  55. if(cmd.getName().equalsIgnoreCase("OFast")) {
  56. player.sendMessage(ChatColor.RED + "Your super sonic speedy boots are now off!");
  57. player.removePotionEffect(PotionEffectType.SPEED);
  58. }
  59.  
  60. if(cmd.getName().equalsIgnoreCase("OSlow")) {
  61. player.sendMessage(ChatColor.RED + "You have lost 500 Pounds GG!");
  62. player.removePotionEffect(PotionEffectType.SLOW);
  63.  
  64. }
  65.  
  66. if(cmd.getName().equalsIgnoreCase("OHigh")) {
  67. player.sendMessage(ChatColor.RED + "Byebye Jordans!");
  68. player.removePotionEffect(PotionEffectType.JUMP);
  69. }
  70.  
  71. return false;
  72.  
  73. }
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement