Guest User

Untitled

a guest
Jun 25th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. package me.Ben.BenjaminCommand;
  2.  
  3. import java.util.logging.Logger;
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.ChatColor;
  7. import org.bukkit.GameMode;
  8. import org.bukkit.Location;
  9. import org.bukkit.World;
  10. import org.bukkit.command.Command;
  11. import org.bukkit.command.CommandSender;
  12. import org.bukkit.entity.Player;
  13. import org.bukkit.plugin.PluginDescriptionFile;
  14. import org.bukkit.plugin.java.JavaPlugin;
  15.  
  16. public class BenjaminCommand extends JavaPlugin {
  17. public final Logger logger = Logger.getLogger("Minecraft");
  18. public static BenjaminCommand plugin;
  19.  
  20. @Override
  21. public void onDisable() {
  22. PluginDescriptionFile pdffile = this.getDescription();
  23. this.logger.info(pdffile.getName() + " Has Been Disabled");
  24.  
  25. }
  26.  
  27.  
  28. @Override
  29. public void onEnable() {
  30. PluginDescriptionFile pdffile = this.getDescription();
  31. this.logger.info(pdffile.getName() + " Version " + pdffile.getVersion() + " Has Been Enabled! ");
  32.  
  33. }
  34.  
  35. public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args)
  36. {
  37. Player player = (Player)sender;
  38.  
  39. if(commandLabel.equalsIgnoreCase("suicide")){
  40. player.setHealth(0);
  41. }else if(commandLabel.equalsIgnoreCase("thor")){
  42. player.getWorld().strikeLightning(player.getLocation());
  43. player.getServer().broadcastMessage(player.getDisplayName() + " Has Been Struck By Lightning");
  44. }else if(commandLabel.equalsIgnoreCase("benjamin")){
  45. player.getServer().broadcastMessage("Benjamin Command Is Working!");
  46. }else if(commandLabel.equalsIgnoreCase("ragequit")){
  47. player.kickPlayer("RageQuit!");
  48. player.getServer().broadcastMessage(player.getDisplayName() + " Has rage quited");
  49. }else if(commandLabel.equalsIgnoreCase("benport"));
  50. if(args.length == 1){
  51. Player targetPlayer = player.getServer().getPlayer(args[0]);
  52. Location TargetPlayerLocation = targetPlayer.getLocation();
  53. player.teleport(TargetPlayerLocation);
  54. }else if(args.length == 2){
  55. Player targetPlayer = player.getServer().getPlayer(args[1]);
  56. Player targetPlayer1 = player.getServer().getPlayer(args[2]);
  57. Location targetPlayer1Location = targetPlayer1.getLocation();
  58. targetPlayer.teleport(targetPlayer1Location);
  59.  
  60. }
  61. return true;
  62. }
  63. }
Add Comment
Please, Sign In to add comment