Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.Kjordo711.Bukkit.SearchAndDestroy;
- import java.util.ArrayList;
- import java.util.Collection;
- import java.util.logging.Logger;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.GameMode;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.enchantments.Enchantment;
- import org.bukkit.enchantments.EnchantmentWrapper;
- import org.bukkit.entity.Item;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- public class SearchAndDestroy extends JavaPlugin{
- private Logger log = Logger.getLogger("Minecraft");
- public ArrayList<String> blueTeam = new ArrayList<String>();
- public ArrayList<String> greenTeam = new ArrayList<String>();
- public int teamDecider = 0;
- ItemStack blueWool = new ItemStack( Material.WOOL, 1, (byte)11 );
- ItemStack emeraldBlock = new ItemStack( Material.EMERALD_BLOCK);
- //Blue
- double bluex = 869;
- double bluey = 5.0;
- double bluez = 818.0;
- //Green
- double greenx = 817;
- double greeny = 5.0;
- double greenz = 831;
- /*
- player.removePotionEffect(PotionEffectType.CONFUSION);
- player.removePotionEffect(PotionEffectType.BLINDNESS);
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.FAST_DIGGING);
- player.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.HARM);
- player.removePotionEffect(PotionEffectType.HEAL);
- player.removePotionEffect(PotionEffectType.HUNGER);
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.removePotionEffect(PotionEffectType.INVISIBILITY);
- player.removePotionEffect(PotionEffectType.NIGHT_VISION);
- player.removePotionEffect(PotionEffectType.POISON);
- player.removePotionEffect(PotionEffectType.REGENERATION);
- player.removePotionEffect(PotionEffectType.SLOW);
- player.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- player.removePotionEffect(PotionEffectType.SPEED);
- player.removePotionEffect(PotionEffectType.WATER_BREATHING);
- player.removePotionEffect(PotionEffectType.WEAKNESS);
- */
- public void onEnable(){
- this.logMessage("[SnD] Has Been Enabled");
- getServer().getPluginManager().registerEvents(new sndPlayerListener(this), this);
- }
- public void onDisable(){
- this.logMessage("[SnD] has been disabled");
- }
- public void logMessage(String msg){
- PluginDescriptionFile pdFile = this.getDescription();
- this.log.info(pdFile.getName() + " " + pdFile.getVersion() + ": " + msg);
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
- Player player = (Player) sender;
- if(cmd.getName().equalsIgnoreCase("Join")){
- teamDecider++;
- if(teamDecider == 3){
- teamDecider = 1;
- }
- if(teamDecider == 1){
- String playerName = player.getName();
- Location blueSpawn = new Location(player.getPlayer().getServer().getWorld("DoomsDay"), bluex, bluey, bluez);
- player.teleport(blueSpawn);
- blueTeam.add(playerName);
- player.getInventory().setHelmet(blueWool);
- player.sendMessage("You are on the " + ChatColor.BLUE + "Blue Team!");
- player.sendMessage("Use " + ChatColor.GOLD + "/Class " + ChatColor.WHITE + "To Choose A Class");
- player.getInventory().clear();
- }
- if(teamDecider == 2){
- String playerName = player.getName();
- Location greenSpawn = new Location(player.getPlayer().getServer().getWorld("DoomsDay"), greenx, greeny, greenz);
- player.teleport(greenSpawn);
- greenTeam.add(playerName);
- player.getInventory().setHelmet(emeraldBlock);
- player.sendMessage("You are on the " + ChatColor.GREEN + "Green Team!");
- player.sendMessage("Use " + ChatColor.GOLD + "/Class " + ChatColor.GRAY + "To Choose A Class");
- player.getInventory().clear();
- }
- if(greenTeam.contains(player)){
- player.sendMessage(ChatColor.RED + "You already are on the " + ChatColor.GREEN + "Green Team!");
- }
- if(blueTeam.contains(player)){
- player.sendMessage(ChatColor.RED + "You already are on the " + ChatColor.GREEN + "Green Team!");
- }
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("Class")){
- String playerName = player.getName();
- player.sendMessage("Normal Class List:");
- player.sendMessage(ChatColor.BLUE + "Scout");
- player.sendMessage(ChatColor.BLUE + "Medic");
- player.sendMessage(ChatColor.BLUE + "Ninja");
- player.sendMessage(ChatColor.BLUE + "Ranger");
- player.sendMessage(ChatColor.BLUE + "Tank");
- player.sendMessage(ChatColor.BLUE + "Assault");
- player.sendMessage(ChatColor.GOLD + "Do /<classname> to choose the class");
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("Scout")){
- String playerName = player.getName();
- player.getInventory().clear();
- player.updateInventory();
- if(greenTeam.contains(playerName)){
- Location greenSpawn = new Location(player.getPlayer().getServer().getWorld("DoomsDay"), greenx, greeny, greenz);
- player.teleport(greenSpawn);
- player.getInventory().setBoots(new ItemStack(Material.LEATHER_BOOTS));
- player.getInventory().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
- player.getInventory().setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));
- player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 99999999, 3));
- player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 999999999, 3));
- player.getInventory().setItemInHand(new ItemStack(Material.STONE_SWORD));
- player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 16));
- player.updateInventory();
- player.removePotionEffect(PotionEffectType.CONFUSION);
- player.removePotionEffect(PotionEffectType.BLINDNESS);
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.FAST_DIGGING);
- player.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.HARM);
- player.removePotionEffect(PotionEffectType.HEAL);
- player.removePotionEffect(PotionEffectType.HUNGER);
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.removePotionEffect(PotionEffectType.INVISIBILITY);
- player.removePotionEffect(PotionEffectType.NIGHT_VISION);
- player.removePotionEffect(PotionEffectType.POISON);
- player.removePotionEffect(PotionEffectType.REGENERATION);
- player.removePotionEffect(PotionEffectType.SLOW);
- player.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- player.removePotionEffect(PotionEffectType.WATER_BREATHING);
- player.removePotionEffect(PotionEffectType.WEAKNESS);
- }
- if(blueTeam.contains(playerName)){
- Location blueSpawn = new Location(player.getPlayer().getServer().getWorld("DoomsDay"), bluex, bluey, bluez);
- player.teleport(blueSpawn);
- player.getInventory().setBoots(new ItemStack(Material.LEATHER_BOOTS));
- player.getInventory().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
- player.getInventory().setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));
- player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 99999999, 3));
- player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 99999999, 3));
- player.getInventory().setItemInHand(new ItemStack(Material.STONE_SWORD));
- player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 16));
- player.updateInventory();
- player.removePotionEffect(PotionEffectType.CONFUSION);
- player.removePotionEffect(PotionEffectType.BLINDNESS);
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.FAST_DIGGING);
- player.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.HARM);
- player.removePotionEffect(PotionEffectType.HEAL);
- player.removePotionEffect(PotionEffectType.HUNGER);
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.removePotionEffect(PotionEffectType.INVISIBILITY);
- player.removePotionEffect(PotionEffectType.NIGHT_VISION);
- player.removePotionEffect(PotionEffectType.POISON);
- player.removePotionEffect(PotionEffectType.REGENERATION);
- player.removePotionEffect(PotionEffectType.SLOW);
- player.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- player.removePotionEffect(PotionEffectType.WATER_BREATHING);
- player.removePotionEffect(PotionEffectType.WEAKNESS);
- }
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("Assault")){
- String playerName = player.getName();
- player.getInventory().clear();
- player.updateInventory();
- if(greenTeam.contains(playerName)){
- Location greenSpawn = new Location(player.getPlayer().getServer().getWorld("DoomsDay"), greenx, greeny, greenz);
- player.teleport(greenSpawn);
- player.getInventory().setBoots(new ItemStack(Material.IRON_BOOTS));
- player.getInventory().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
- player.getInventory().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
- player.getInventory().setItemInHand(new ItemStack(Material.IRON_SWORD));
- player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 16));
- player.updateInventory();
- player.removePotionEffect(PotionEffectType.CONFUSION);
- player.removePotionEffect(PotionEffectType.BLINDNESS);
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.FAST_DIGGING);
- player.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.HARM);
- player.removePotionEffect(PotionEffectType.HEAL);
- player.removePotionEffect(PotionEffectType.HUNGER);
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.removePotionEffect(PotionEffectType.INVISIBILITY);
- player.removePotionEffect(PotionEffectType.NIGHT_VISION);
- player.removePotionEffect(PotionEffectType.POISON);
- player.removePotionEffect(PotionEffectType.REGENERATION);
- player.removePotionEffect(PotionEffectType.SLOW);
- player.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- player.removePotionEffect(PotionEffectType.WATER_BREATHING);
- player.removePotionEffect(PotionEffectType.WEAKNESS);
- }
- if(blueTeam.contains(playerName)){
- Location blueSpawn = new Location(player.getPlayer().getServer().getWorld("DoomsDay"), bluex, bluey, bluez);
- player.teleport(blueSpawn);
- player.getInventory().setBoots(new ItemStack(Material.IRON_BOOTS));
- player.getInventory().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
- player.getInventory().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
- player.getInventory().setItemInHand(new ItemStack(Material.IRON_SWORD));
- player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 16));
- player.updateInventory();
- player.removePotionEffect(PotionEffectType.CONFUSION);
- player.removePotionEffect(PotionEffectType.BLINDNESS);
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.FAST_DIGGING);
- player.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.HARM);
- player.removePotionEffect(PotionEffectType.HEAL);
- player.removePotionEffect(PotionEffectType.HUNGER);
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.removePotionEffect(PotionEffectType.INVISIBILITY);
- player.removePotionEffect(PotionEffectType.NIGHT_VISION);
- player.removePotionEffect(PotionEffectType.POISON);
- player.removePotionEffect(PotionEffectType.REGENERATION);
- player.removePotionEffect(PotionEffectType.SLOW);
- player.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- player.removePotionEffect(PotionEffectType.WATER_BREATHING);
- player.removePotionEffect(PotionEffectType.WEAKNESS);
- }
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("Ranger")){
- String playerName = player.getName();
- player.getInventory().clear();
- player.updateInventory();
- if(greenTeam.contains(playerName)){
- Location greenSpawn = new Location(player.getPlayer().getServer().getWorld("DoomsDay"), greenx, greeny, greenz);
- player.teleport(greenSpawn);
- player.getInventory().setBoots(new ItemStack(Material.LEATHER_BOOTS));
- player.getInventory().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
- player.getInventory().setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));
- player.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
- ItemStack bow = new ItemStack(Material.BOW);
- player.getInventory().setItemInHand(new ItemStack(Material.BOW));
- bow.addEnchantment(Enchantment.ARROW_INFINITE, 1);
- bow.addEnchantment(Enchantment.ARROW_DAMAGE, 3);
- player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 16));
- player.getInventory().addItem(new ItemStack(Material.ARROW, 1));
- player.updateInventory();
- player.removePotionEffect(PotionEffectType.CONFUSION);
- player.removePotionEffect(PotionEffectType.BLINDNESS);
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.FAST_DIGGING);
- player.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.HARM);
- player.removePotionEffect(PotionEffectType.HEAL);
- player.removePotionEffect(PotionEffectType.HUNGER);
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.removePotionEffect(PotionEffectType.INVISIBILITY);
- player.removePotionEffect(PotionEffectType.NIGHT_VISION);
- player.removePotionEffect(PotionEffectType.POISON);
- player.removePotionEffect(PotionEffectType.REGENERATION);
- player.removePotionEffect(PotionEffectType.SLOW);
- player.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- player.removePotionEffect(PotionEffectType.WATER_BREATHING);
- player.removePotionEffect(PotionEffectType.WEAKNESS);
- }
- if(blueTeam.contains(playerName)){
- Location blueSpawn = new Location(player.getPlayer().getServer().getWorld("DoomsDay"), bluex, bluey, bluez);
- player.teleport(blueSpawn);
- player.getInventory().setBoots(new ItemStack(Material.LEATHER_BOOTS));
- player.getInventory().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
- player.getInventory().setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));
- player.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
- ItemStack bow = new ItemStack(Material.BOW);
- bow.addEnchantment(Enchantment.ARROW_INFINITE, 1);
- bow.addEnchantment(Enchantment.ARROW_DAMAGE, 3);
- player.getInventory().setItemInHand(new ItemStack(Material.BOW));
- player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 16));
- player.getInventory().addItem(new ItemStack(Material.ARROW, 1));
- player.updateInventory();
- player.removePotionEffect(PotionEffectType.CONFUSION);
- player.removePotionEffect(PotionEffectType.BLINDNESS);
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.FAST_DIGGING);
- player.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.HARM);
- player.removePotionEffect(PotionEffectType.HEAL);
- player.removePotionEffect(PotionEffectType.HUNGER);
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.removePotionEffect(PotionEffectType.INVISIBILITY);
- player.removePotionEffect(PotionEffectType.NIGHT_VISION);
- player.removePotionEffect(PotionEffectType.POISON);
- player.removePotionEffect(PotionEffectType.REGENERATION);
- player.removePotionEffect(PotionEffectType.SLOW);
- player.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- player.removePotionEffect(PotionEffectType.WATER_BREATHING);
- player.removePotionEffect(PotionEffectType.WEAKNESS);
- }
- return true;
- }
- if(cmd.getName().equalsIgnoreCase("Tank")){
- String playerName = player.getName();
- player.getInventory().clear();
- player.updateInventory();
- if(greenTeam.contains(playerName)){
- Location greenSpawn = new Location(player.getPlayer().getServer().getWorld("DoomsDay"), greenx, greeny, greenz);
- player.teleport(greenSpawn);
- player.getInventory().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
- player.getInventory().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
- player.getInventory().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
- ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
- sword.addEnchantment(Enchantment.DAMAGE_ALL, 1);
- player.getInventory().setItemInHand(new ItemStack(Material.DIAMOND_SWORD));
- player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 99999999, 1));
- player.updateInventory();
- player.removePotionEffect(PotionEffectType.CONFUSION);
- player.removePotionEffect(PotionEffectType.BLINDNESS);
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.FAST_DIGGING);
- player.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.HARM);
- player.removePotionEffect(PotionEffectType.HEAL);
- player.removePotionEffect(PotionEffectType.HUNGER);
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.removePotionEffect(PotionEffectType.INVISIBILITY);
- player.removePotionEffect(PotionEffectType.NIGHT_VISION);
- player.removePotionEffect(PotionEffectType.POISON);
- player.removePotionEffect(PotionEffectType.REGENERATION);
- player.removePotionEffect(PotionEffectType.SLOW);
- player.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- player.removePotionEffect(PotionEffectType.WATER_BREATHING);
- player.removePotionEffect(PotionEffectType.WEAKNESS);
- }
- if(blueTeam.contains(playerName)){
- Location blueSpawn = new Location(player.getPlayer().getServer().getWorld("DoomsDay"), bluex, bluey, bluez);
- player.teleport(blueSpawn);
- player.getInventory().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
- player.getInventory().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
- player.getInventory().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
- ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
- sword.addEnchantment(Enchantment.DAMAGE_ALL, 1);
- player.getInventory().setItemInHand(new ItemStack(Material.DIAMOND_SWORD));
- player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 99999999, 1));
- player.updateInventory();
- player.removePotionEffect(PotionEffectType.CONFUSION);
- player.removePotionEffect(PotionEffectType.BLINDNESS);
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.FAST_DIGGING);
- player.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.HARM);
- player.removePotionEffect(PotionEffectType.HEAL);
- player.removePotionEffect(PotionEffectType.HUNGER);
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.removePotionEffect(PotionEffectType.INVISIBILITY);
- player.removePotionEffect(PotionEffectType.NIGHT_VISION);
- player.removePotionEffect(PotionEffectType.POISON);
- player.removePotionEffect(PotionEffectType.REGENERATION);
- player.removePotionEffect(PotionEffectType.SLOW);
- player.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- player.removePotionEffect(PotionEffectType.WATER_BREATHING);
- player.removePotionEffect(PotionEffectType.WEAKNESS);
- }
- return true;
- }
- return false;
- }
- }
Add Comment
Please, Sign In to add comment