Guest User

Untitled

a guest
Apr 25th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.85 KB | None | 0 0
  1. package me.iMint.mintCMD;
  2.  
  3. import java.util.logging.Logger;
  4.  
  5. import org.bukkit.ChatColor;
  6. import org.bukkit.GameMode;
  7. import org.bukkit.command.Command;
  8. import org.bukkit.command.CommandSender;
  9. import org.bukkit.entity.Player;
  10. import org.bukkit.plugin.java.JavaPlugin;
  11.  
  12. public class mintCMD extends JavaPlugin {
  13.  
  14. Logger log = Logger.getLogger("Minecraft");
  15.  
  16. @Override
  17. public void onEnable(){
  18. log.info("mintCMD has been enabled in mint condition!");
  19.  
  20. }
  21.  
  22. @Override
  23. public void onDisable(){
  24. log.info("mintCMD has been disabled.");
  25. }
  26.  
  27. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args, Player player) {
  28. //COMMENTED ChatColors are colors that are not being used in this plugin yet.
  29. // ChatColor RED = ChatColor.RED;
  30. ChatColor WHITE = ChatColor.WHITE;
  31. ChatColor BLUE = ChatColor.BLUE;
  32. ChatColor GOLD = ChatColor.GOLD;
  33. ChatColor PURPLE = ChatColor.DARK_PURPLE;
  34. ChatColor PINK = ChatColor.LIGHT_PURPLE;
  35. // ChatColor YELLOW = ChatColor.YELLOW;
  36. // ChatColor AQUA = ChatColor.AQUA;
  37. // ChatColor DARKRED = ChatColor.DARK_RED;
  38. // ChatColor BLACK = ChatColor.BLACK;
  39. ChatColor GREEN = ChatColor.GREEN;
  40. // ChatColor DARKGREEN = ChatColor.DARK_GREEN;
  41. // ChatColor DARKBLUE = ChatColor.DARK_BLUE;
  42.  
  43.  
  44.  
  45. // ,--, ,------------------------------, ,--,
  46. // | |====================================| -------- |====================================| |
  47. // | |====================================| `*~ --- |COMMANDS| --- ~*` |====================================| |
  48. // | |====================================| -------- |====================================| |
  49. // '--' '------------------------------' '--'
  50.  
  51. // ,-, ,----------------, ,-,
  52. // | |===========| /mintCMD |===========| |
  53. // '-' '----------------' '-'
  54.  
  55. if(cmd.getName().equalsIgnoreCase("mintCMD")) {
  56. sender.sendMessage(GOLD +",------------------------");
  57. // ,-----------------------
  58. sender.sendMessage(GOLD + "| " + GREEN + "mintCMD Command List:");
  59. // | mintCMD Command List:
  60. sender.sendMessage(GOLD + "| " + PINK + "/mintCMD " + WHITE + "- Brings up this Command List");
  61. // | /mintCMD - Brings up this Command List
  62. sender.sendMessage(GOLD + "| " + PINK + "/mode " + PURPLE + "[player] " + WHITE + "- Changes " + PURPLE + "(player)" + WHITE + "'s gamemode");
  63. // | /mode (player) - Changes (player)'s gamemode
  64. sender.sendMessage(GOLD + "| " + PINK + "/day " + WHITE + "- Sets the time to DAY");
  65. // | /day - Sets the time to DAY
  66. sender.sendMessage(GOLD + "| " + PINK + "/night " + WHITE + "- Sets the time to NIGHT");
  67. // | /night - Sets the time to NIGHT
  68. sender.sendMessage(GOLD + "| " + PINK + "/kill " + PURPLE + "(player) " + WHITE + "- Kills " + PURPLE + "(player)");
  69. // | /kill (player) - Kills (player)
  70. sender.sendMessage(GOLD + "| " + PINK + "/mob " + PURPLE + "(mob) " + BLUE + "[amount] " + WHITE + "- Spawns " + BLUE + "(amount) " + WHITE + "of " + PURPLE + "(mob)");
  71. // | /mob (mob) [amount] - Spawns [amount] of (mob)
  72. sender.sendMessage(GOLD + "| " + PINK + "/i " + PURPLE + "(item) " + BLUE + "(amount) " + PURPLE + "[player] " + WHITE + "- Gives " + BLUE + "(amount) " + WHITE + "of " + PURPLE + "(item) " + WHITE + "to " + PURPLE + "[player]");
  73. // | /i (item) (amount) [player] - Gives (amount) of (item) to [player]
  74. sender.sendMessage(GOLD + "| " + PINK + "/clearmobs " + BLUE + "(radius) " + WHITE + "- Kills all mobs within " + BLUE + "(radius) " + WHITE + "blocks");
  75. // | /clearmobs (radius) - Kills all mobs within (radius) blocks
  76. sender.sendMessage(GOLD + "| " + PINK + "/superkick" + WHITE + "- Kicks all players except you");
  77. // | /superkick - Kicks all players except you
  78. sender.sendMessage(GOLD + "| " + PINK + "/superban" + WHITE + "- Bans all players except you");
  79. // | /superban - Bans all players except you
  80. sender.sendMessage(GOLD + "| " + PINK + "/tp " + PURPLE + "[player] (destination-player) " + WHITE + "- Teleports " + PURPLE + "(player) " + WHITE + "to " + PURPLE + "(destination-player)");
  81. // | /tp [player] (destination-player) - Teleports [player] to (destination-player)
  82. sender.sendMessage(GOLD + "| " + PINK + "/tphere " + PURPLE + "(player) " + WHITE + "- Teleports " + PURPLE + "(player) " + WHITE + "to your location");
  83. // | /tphere (player) - Teleports (player) to your location
  84. return true;
  85. }
  86.  
  87. // ,-, ,------------------------, ,-,
  88. // | |===========| /mode (player) |===========| |
  89. // '-' '------------------------' '-'
  90.  
  91. else if(cmd.getName().equalsIgnoreCase("mode")) {
  92. if(args[0] == null) {
  93. if(player.getGameMode() == GameMode.SURVIVAL) {
  94. player.setGameMode(GameMode.CREATIVE);
  95. player.sendMessage(GOLD + "You are now in CREATIVE mode.");
  96. }
  97. else if(player.getGameMode() == GameMode.CREATIVE) {
  98. player.setGameMode(GameMode.SURVIVAL);
  99. player.sendMessage(GOLD + "You are now in SURVIVAL mode.");
  100. }
  101. }
  102. else {
  103. Player rec = getServer().getPlayer(args[0]);
  104. if(rec.getGameMode() == GameMode.SURVIVAL) {
  105. rec.setGameMode(GameMode.CREATIVE);
  106. rec.sendMessage(GOLD + "You are now in CREATIVE mode.");
  107. sender.sendMessage(GOLD + args[0] + " is now in CREATIVE mode.");
  108. }
  109. else if(rec.getGameMode() == GameMode.CREATIVE) {
  110. rec.setGameMode(GameMode.SURVIVAL);
  111. rec.sendMessage(GOLD + "You are now in SURVIVAL mode.");
  112. sender.sendMessage(GOLD + args[0] + " is now in SURVIVAL mode.");
  113. }
  114. }
  115. return true;
  116. }
  117.  
  118. // ,-, ,------------, ,-,
  119. // | |===========| /day |===========| |
  120. // '-' '------------' '-'
  121.  
  122. else if(cmd.getName().equalsIgnoreCase("day")) {
  123. player.getWorld().setTime(0);
  124. }
  125.  
  126. return false;
  127.  
  128. }
  129.  
  130. }
Add Comment
Please, Sign In to add comment