Advertisement
Guest User

Code

a guest
Jul 16th, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 10.46 KB | None | 0 0
  1. package com.Zach.Soundmaker;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.Sound;
  6. import org.bukkit.plugin.java.JavaPlugin;
  7. import org.bukkit.command.CommandSender;
  8. import org.bukkit.command.Command;
  9. import org.bukkit.entity.Player;
  10.  
  11. public class Main extends JavaPlugin {
  12.         public void onEnable() {
  13.             getLogger().info("Soundmaker 3000 playing sounds successfully!! Oh no! It's a zombie! Oh wait thats just this plugin...");
  14.         }
  15.         public void onDisable() {
  16.             getLogger().info("Soundmaker 3000 shutting dowwwwwwn");
  17.         }
  18.         public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args ) {
  19.         if(commandLabel.equalsIgnoreCase("GhastSound")) {
  20.             Player player = (Player) sender;
  21.             @SuppressWarnings("deprecation")
  22.             Player target = Bukkit.getPlayerExact(args[0]);
  23.             if(target == null) {
  24.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  25.             }
  26.             if(args.length <1 || args.length >= 2) {
  27.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /GhastSound (Player). Try /Soundmaker help for more help!");
  28.             }
  29.             if (args.length == 1) {
  30.             int volume = 1;
  31.             float pitch = 1.0f;
  32.             target.playSound(player.getLocation(), Sound.GHAST_SCREAM, volume, pitch );
  33.             }
  34.             return true;
  35.         }
  36.         if(commandLabel.equalsIgnoreCase("ZombieSound")) {
  37.             Player player = (Player) sender;
  38.             @SuppressWarnings("deprecation")
  39.             Player target = Bukkit.getPlayerExact(args[0]);
  40.             if(target == null) {
  41.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  42.             }
  43.             if(args.length <1 || args.length >= 2) {
  44.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /ZombieSound (Player). Try /Soundmaker help for more help!");
  45.             }
  46.             if (args.length == 1) {
  47.             int volume = 1;
  48.             float pitch = 1.0f;
  49.             target.playSound(player.getLocation(), Sound.ZOMBIE_IDLE, volume, pitch );
  50.             }
  51.             return true;
  52.         }
  53.        
  54.         if(commandLabel.equalsIgnoreCase("SkeletonSound")) {
  55.             Player player = (Player) sender;
  56.             @SuppressWarnings("deprecation")
  57.             Player target = Bukkit.getPlayerExact(args[0]);
  58.             if(target == null) {
  59.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  60.             }
  61.             if(args.length <1 || args.length >= 2) {
  62.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /SkeletonSound (Player). Try /Soundmaker help for more help!");
  63.             }
  64.             if (args.length == 1) {
  65.             int volume = 1;
  66.             float pitch = 1.0f;
  67.             target.playSound(player.getLocation(), Sound.SKELETON_IDLE, volume, pitch );
  68.             }
  69.             return true;
  70.         }
  71.         if(commandLabel.equalsIgnoreCase("SpiderSound")) {
  72.             Player player = (Player) sender;
  73.             @SuppressWarnings("deprecation")
  74.             Player target = Bukkit.getPlayerExact(args[0]);
  75.             if(target == null) {
  76.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  77.             }
  78.             if(args.length <1 || args.length >= 2) {
  79.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /SpiderSound (Player). Try /Soundmaker help for more help!");
  80.             }
  81.             if (args.length == 1) {
  82.             int volume = 1;
  83.             float pitch = 1.0f;
  84.             target.playSound(player.getLocation(), Sound.SPIDER_IDLE, volume, pitch );
  85.             }
  86.             return true;
  87.         }
  88.         if(commandLabel.equalsIgnoreCase("SlimeSound")) {
  89.             Player player = (Player) sender;
  90.             @SuppressWarnings("deprecation")
  91.             Player target = Bukkit.getPlayerExact(args[0]);
  92.             if(target == null) {
  93.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  94.             }
  95.             if(args.length <1 || args.length >= 2) {
  96.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /SlimeSound (Player). Try /Soundmaker help for more help!");
  97.             }
  98.             if (args.length == 1) {
  99.             int volume = 1;
  100.             float pitch = 1.0f;
  101.             target.playSound(player.getLocation(), Sound.SLIME_WALK, volume, pitch );
  102.             }
  103.             return true;
  104.         }
  105.        
  106.         if(commandLabel.equalsIgnoreCase("BlazeSound")) {
  107.             Player player = (Player) sender;
  108.             @SuppressWarnings("deprecation")
  109.             Player target = Bukkit.getPlayerExact(args[0]);
  110.             if(target == null) {
  111.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  112.             }
  113.             if(args.length <1 || args.length >= 2) {
  114.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /BlazeSound (Player). Try /Soundmaker help for more help!");
  115.             }
  116.             if (args.length == 1) {
  117.             int volume = 1;
  118.             float pitch = 1.0f;
  119.             target.playSound(player.getLocation(), Sound.BLAZE_BREATH, volume, pitch );
  120.             }
  121.             return true;
  122.         }
  123.         if(commandLabel.equalsIgnoreCase("EnderDragonSound")) {
  124.             Player player = (Player) sender;
  125.             @SuppressWarnings("deprecation")
  126.             Player target = Bukkit.getPlayerExact(args[0]);
  127.             if(target == null) {
  128.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  129.             }
  130.             if(args.length <1 || args.length >= 2) {
  131.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /EnderDragonSound (Player). Try /Soundmaker help for more help!");
  132.             }
  133.             if (args.length == 1) {
  134.             int volume = 1;
  135.             float pitch = 1.0f;
  136.             target.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, volume, pitch );
  137.             }
  138.             return true;
  139.         }
  140.         if(commandLabel.equalsIgnoreCase("EndermanSound")) {
  141.             Player player = (Player) sender;
  142.             @SuppressWarnings("deprecation")
  143.             Player target = Bukkit.getPlayerExact(args[0]);
  144.             if(target == null) {
  145.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  146.             }
  147.             if(args.length <1 || args.length >= 2) {
  148.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /EndermanSound (Player). Try /Soundmaker help for more help!");
  149.             }
  150.             if (args.length == 1) {
  151.             int volume = 1;
  152.             float pitch = 1.0f;
  153.             target.playSound(player.getLocation(), Sound.ENDERMAN_SCREAM, volume, pitch );
  154.             target.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, volume, pitch );
  155.             }
  156.             return true;
  157.         }
  158.         if(commandLabel.equalsIgnoreCase("SilverfishSound")) {
  159.             Player player = (Player) sender;
  160.             @SuppressWarnings("deprecation")
  161.             Player target = Bukkit.getPlayerExact(args[0]);
  162.             if(target == null) {
  163.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  164.             }
  165.             if(args.length <1 || args.length >= 2) {
  166.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /SilverfishSound (Player). Try /Soundmaker help for more help!");
  167.             }
  168.             if (args.length == 1) {
  169.             int volume = 1;
  170.             float pitch = 1.0f;
  171.             target.playSound(player.getLocation(), Sound.SILVERFISH_WALK, volume, pitch );
  172.             }
  173.             return true;
  174.         }
  175.         if(commandLabel.equalsIgnoreCase("MagmaCubeSound")) {
  176.             Player player = (Player) sender;
  177.             @SuppressWarnings("deprecation")
  178.             Player target = Bukkit.getPlayerExact(args[0]);
  179.             if(target == null) {
  180.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  181.             }
  182.             if(args.length <1 || args.length >= 2) {
  183.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /MagmaCubeSound (Player). Try /Soundmaker help for more help!");
  184.             }
  185.             if (args.length == 1) {
  186.             int volume = 1;
  187.             float pitch = 1.0f;
  188.             target.playSound(player.getLocation(), Sound.MAGMACUBE_JUMP, volume, pitch );
  189.             }
  190.             return true;
  191.         }
  192.         if(commandLabel.equalsIgnoreCase("CreeperSound")) {
  193.             Player player = (Player) sender;
  194.             @SuppressWarnings("deprecation")
  195.             Player target = Bukkit.getPlayerExact(args[0]);
  196.             if(target == null) {
  197.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  198.             }
  199.             if(args.length <1 || args.length >= 2) {
  200.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /CreeperSound (Player). Try /Soundmaker help for more help!");
  201.             }
  202.             if (args.length == 1) {
  203.             int volume = 1;
  204.             float pitch = 1.0f;
  205.             target.playSound(player.getLocation(), Sound.CREEPER_HISS, volume, pitch );
  206.             target.playSound(player.getLocation(), Sound.EXPLODE, volume, pitch );
  207.             }
  208.             return true;
  209.         }
  210.         if(commandLabel.equalsIgnoreCase("WitherSound")) {
  211.             Player player = (Player) sender;
  212.             @SuppressWarnings("deprecation")
  213.             Player target = Bukkit.getPlayerExact(args[0]);
  214.             if(target == null) {
  215.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  216.             }
  217.             if(args.length <1 || args.length >= 2) {
  218.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /WitherSound (Player). Try /Soundmaker help for more help!");
  219.             }
  220.             if (args.length == 1) {
  221.             int volume = 1;
  222.             float pitch = 1.0f;
  223.             target.playSound(player.getLocation(), Sound.WITHER_SPAWN, volume, pitch );
  224.             target.playSound(player.getLocation(), Sound.WITHER_SHOOT, volume, pitch );
  225.             }
  226.             return true;
  227.         }
  228.         if (commandLabel.equalsIgnoreCase("Soundmaker") && sender instanceof Player) {
  229.             Player player = (Player) sender;
  230.             @SuppressWarnings("deprecation")
  231.             Player target = Bukkit.getPlayerExact(args[0]);
  232.             if(target == null) {
  233.                 player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
  234.             }
  235.             if(args.length <1 || args.length >= 2) {
  236.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments!");
  237.             }
  238.             if(args.length > 0) {
  239.             if(args[0].equalsIgnoreCase("Help")); {
  240.             player.sendMessage(ChatColor.YELLOW + "" + ChatColor.BOLD + "Welcome To Soundmaker 3000, the ultimate trolling plugin! By ZachAttack1170!!");
  241.             player.sendMessage(ChatColor.YELLOW + "Type /(Sound) (Player) to start!"
  242.                                     + ChatColor.YELLOW + "\n" + ChatColor.BOLD + "Options:"
  243.                                     + ChatColor.YELLOW + "\n* /GhastSound"
  244.                                     + ChatColor.YELLOW + "\n* /CreeperSound"
  245.                                     + ChatColor.YELLOW + "\n* /WitherSound"
  246.                                     + ChatColor.YELLOW + "\n* /MagmaCubeSound"
  247.                                     + ChatColor.YELLOW + "\n* /SilverfishSound"
  248.                                     + ChatColor.YELLOW + "\n* /EndermanSound"
  249.                                     + ChatColor.YELLOW + "\n* /EnderDragonSound"
  250.                                     + ChatColor.YELLOW + "\n* /BlazeSound"
  251.                                     + ChatColor.YELLOW + "\n* /SlimeSound"
  252.                                     + ChatColor.YELLOW + "\n* /SkeletonSound"
  253.                                     + ChatColor.YELLOW + "\n* /ZombieSound"
  254.                                     + ChatColor.YELLOW + "\n* /SpiderSound");                                          
  255.             }
  256.                 }
  257.             return true;
  258.         }
  259.         return false;
  260.     }
  261. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement