Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.Zach.Soundmaker;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.Sound;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.command.CommandSender;
- import org.bukkit.command.Command;
- import org.bukkit.entity.Player;
- public class Main extends JavaPlugin {
- public void onEnable() {
- getLogger().info("Soundmaker 3000 playing sounds successfully!! Oh no! It's a zombie! Oh wait thats just this plugin...");
- }
- public void onDisable() {
- getLogger().info("Soundmaker 3000 shutting dowwwwwwn");
- }
- public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args ) {
- if(commandLabel.equalsIgnoreCase("GhastSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /GhastSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.GHAST_SCREAM, volume, pitch );
- }
- return true;
- }
- if(commandLabel.equalsIgnoreCase("ZombieSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /ZombieSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.ZOMBIE_IDLE, volume, pitch );
- }
- return true;
- }
- if(commandLabel.equalsIgnoreCase("SkeletonSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /SkeletonSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.SKELETON_IDLE, volume, pitch );
- }
- return true;
- }
- if(commandLabel.equalsIgnoreCase("SpiderSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /SpiderSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.SPIDER_IDLE, volume, pitch );
- }
- return true;
- }
- if(commandLabel.equalsIgnoreCase("SlimeSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /SlimeSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.SLIME_WALK, volume, pitch );
- }
- return true;
- }
- if(commandLabel.equalsIgnoreCase("BlazeSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /BlazeSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.BLAZE_BREATH, volume, pitch );
- }
- return true;
- }
- if(commandLabel.equalsIgnoreCase("EnderDragonSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /EnderDragonSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, volume, pitch );
- }
- return true;
- }
- if(commandLabel.equalsIgnoreCase("EndermanSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /EndermanSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.ENDERMAN_SCREAM, volume, pitch );
- target.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, volume, pitch );
- }
- return true;
- }
- if(commandLabel.equalsIgnoreCase("SilverfishSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /SilverfishSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.SILVERFISH_WALK, volume, pitch );
- }
- return true;
- }
- if(commandLabel.equalsIgnoreCase("MagmaCubeSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /MagmaCubeSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.MAGMACUBE_JUMP, volume, pitch );
- }
- return true;
- }
- if(commandLabel.equalsIgnoreCase("CreeperSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /CreeperSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.CREEPER_HISS, volume, pitch );
- target.playSound(player.getLocation(), Sound.EXPLODE, volume, pitch );
- }
- return true;
- }
- if(commandLabel.equalsIgnoreCase("WitherSound")) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments. /WitherSound (Player). Try /Soundmaker help for more help!");
- }
- if (args.length == 1) {
- int volume = 1;
- float pitch = 1.0f;
- target.playSound(player.getLocation(), Sound.WITHER_SPAWN, volume, pitch );
- target.playSound(player.getLocation(), Sound.WITHER_SHOOT, volume, pitch );
- }
- return true;
- }
- if (commandLabel.equalsIgnoreCase("Soundmaker") && sender instanceof Player) {
- Player player = (Player) sender;
- @SuppressWarnings("deprecation")
- Player target = Bukkit.getPlayerExact(args[0]);
- if(target == null) {
- player.sendMessage(ChatColor.RED + "That player is either offline or doesn't exist!!");
- }
- if(args.length <1 || args.length >= 2) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Too many/little arguments!");
- }
- if(args.length > 0) {
- if(args[0].equalsIgnoreCase("Help")); {
- player.sendMessage(ChatColor.YELLOW + "" + ChatColor.BOLD + "Welcome To Soundmaker 3000, the ultimate trolling plugin! By ZachAttack1170!!");
- player.sendMessage(ChatColor.YELLOW + "Type /(Sound) (Player) to start!"
- + ChatColor.YELLOW + "\n" + ChatColor.BOLD + "Options:"
- + ChatColor.YELLOW + "\n* /GhastSound"
- + ChatColor.YELLOW + "\n* /CreeperSound"
- + ChatColor.YELLOW + "\n* /WitherSound"
- + ChatColor.YELLOW + "\n* /MagmaCubeSound"
- + ChatColor.YELLOW + "\n* /SilverfishSound"
- + ChatColor.YELLOW + "\n* /EndermanSound"
- + ChatColor.YELLOW + "\n* /EnderDragonSound"
- + ChatColor.YELLOW + "\n* /BlazeSound"
- + ChatColor.YELLOW + "\n* /SlimeSound"
- + ChatColor.YELLOW + "\n* /SkeletonSound"
- + ChatColor.YELLOW + "\n* /ZombieSound"
- + ChatColor.YELLOW + "\n* /SpiderSound");
- }
- }
- return true;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement