Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.junkstyle.SoulCatcher;
- import java.util.Arrays;
- import java.util.HashMap;
- import java.util.Random;
- import org.bukkit.Bukkit;
- import org.bukkit.Material;
- import org.bukkit.Sound;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Entity;
- import org.bukkit.entity.EntityType;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.Action;
- import org.bukkit.event.entity.EntityDeathEvent;
- import org.bukkit.event.inventory.PrepareItemCraftEvent;
- import org.bukkit.event.player.PlayerInteractEvent;
- import org.bukkit.inventory.CraftingInventory;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.ShapedRecipe;
- import org.bukkit.inventory.meta.ItemMeta;
- import org.bukkit.permissions.Permission;
- import org.bukkit.plugin.PluginManager;
- import org.bukkit.plugin.java.JavaPlugin;
- import com.junkstyle.SoulCatcher.commands.HowToFix;
- import net.md_5.bungee.api.ChatColor;
- public class Main extends JavaPlugin implements Listener {
- @SuppressWarnings("deprecation")
- public void onEnable() {
- System.out.println("Soul Catcher Plugin Working Fine!");
- Bukkit.getPluginManager().registerEvents(this, this);
- getCommand("howtofix").setExecutor(new HowToFix());
- //Craft System
- ItemStack SoulCatcher = new ItemStack(Material.GLASS_BOTTLE, 1);
- ItemMeta im2 = SoulCatcher.getItemMeta();
- im2.setDisplayName(ChatColor.BOLD + "" + ChatColor.AQUA + "Soul Catcher");
- im2.setLore(Arrays.asList(ChatColor.GOLD + "Kill mob with this item",ChatColor.GOLD + "to catch his souls!", ""));
- SoulCatcher.setItemMeta(im2);
- SoulCatcher.setItemMeta(im2);
- ItemStack blaze = new ItemStack(Material.BLAZE_POWDER, 4);
- ItemMeta im4 = blaze.getItemMeta();
- im4.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "Upgraded Blaze Powder");
- im4.setLore(Arrays.asList(ChatColor.GOLD + "You can use this magical",ChatColor.GOLD + "Blaze Powder to fix", ChatColor.GOLD + "your broken Soul Catchers!"));
- blaze.setItemMeta(im4);
- ShapedRecipe bottle = new ShapedRecipe(SoulCatcher);
- bottle.shape("@@@", "&%&", "$*$");
- bottle.setIngredient('@', Material.DIAMOND);
- bottle.setIngredient('$', Material.BLAZE_POWDER);
- bottle.setIngredient('%', Material.GLASS_BOTTLE);
- bottle.setIngredient('&', Material.EYE_OF_ENDER);
- bottle.setIngredient('*', Material.EMERALD);
- getServer().addRecipe(bottle);
- ShapedRecipe powder = new ShapedRecipe(blaze);
- powder.shape("@@@", "#$#", "@@@");
- powder.setIngredient('@', Material.AIR);
- powder.setIngredient('#', Material.DIAMOND);
- powder.setIngredient('$', Material.BLAZE_POWDER);
- getServer().addRecipe(powder);
- //
- //Permission
- PluginManager pm = Bukkit.getPluginManager();
- Permission p = new Permission("soulcatcher.commands");
- pm.addPermission(p);
- }
- //Broken Fix
- @SuppressWarnings("serial")
- @EventHandler
- public void OnPlayerCraftItem(PrepareItemCraftEvent e) {
- ItemStack broken = new ItemStack(Material.GLASS_BOTTLE, 1);
- ItemMeta im3 = broken.getItemMeta();
- im3.setDisplayName(ChatColor.BOLD + "" + ChatColor.GRAY + "Broken Soul Catcher");
- im3.setLore(Arrays.asList(ChatColor.GOLD + "Use /howtofix",ChatColor.GOLD + "to learn how to fix the", ChatColor.GOLD + "Soul Catcher!"));
- broken.setItemMeta(im3);
- ItemStack SoulCatcher = new ItemStack(Material.GLASS_BOTTLE, 1);
- ItemMeta im2 = SoulCatcher.getItemMeta();
- im2.setDisplayName(ChatColor.BOLD + "" + ChatColor.AQUA + "Soul Catcher");
- im2.setLore(Arrays.asList(ChatColor.GOLD + "Kill mob with this item",ChatColor.GOLD + "to catch his souls!", ""));
- SoulCatcher.setItemMeta(im2);
- ItemStack blaze = new ItemStack(Material.BLAZE_POWDER);
- ItemMeta im4 = blaze.getItemMeta();
- im4.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "Upgraded Blaze Powder");
- im4.setLore(Arrays.asList(ChatColor.GOLD + "You can use this magical",ChatColor.GOLD + "Blaze Powder to fix", ChatColor.GOLD + "your broken Soul Catchers!"));
- blaze.setItemMeta(im4);
- if(e.getInventory().getMatrix().length < 9) {
- return;
- }
- checkCraft(SoulCatcher, e.getInventory(), new HashMap<Integer, ItemStack>(){{
- put(4, broken);
- put(0, blaze);
- put(1, blaze);
- put(2, blaze);
- put(3, blaze);
- put(5, blaze);
- put(6, blaze);
- put(7, blaze);
- put(8, blaze);
- }});
- }
- public void checkCraft(ItemStack result, CraftingInventory inv, HashMap<Integer, ItemStack> Ingrediants) {
- ItemStack [] matrix = inv.getMatrix();
- for(int i = 0; i < 9; i++) {
- if(Ingrediants.containsKey(i)) {
- if (matrix[i] == null || !matrix[i].equals(Ingrediants.get(i))) {
- return;
- }
- } else {
- if(matrix[i] != null) {
- return;
- }
- }
- }
- inv.setResult(result);
- }
- //Soul Catch System
- @EventHandler
- public void OnDeath(EntityDeathEvent e) {
- Player player = e.getEntity().getKiller();
- Entity killed = e.getEntity();
- //Cow
- ItemStack cow = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta im = cow.getItemMeta();
- im.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Cow's Soul");
- im.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- cow.setItemMeta(im);
- //Pig
- ItemStack pig = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imp = cow.getItemMeta();
- imp.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Pig's Soul");
- imp.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- pig.setItemMeta(imp);
- ItemStack skel = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imsk = skel.getItemMeta();
- imsk.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Skeleton's Soul");
- imsk.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- skel.setItemMeta(imsk);
- ItemStack zom = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imsz = zom.getItemMeta();
- imsz.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Zombie's Soul");
- imsz.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- zom.setItemMeta(imsz);
- ItemStack cre = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imsc = cre.getItemMeta();
- imsc.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Creeper's Soul");
- imsc.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- cre.setItemMeta(imsc);
- ItemStack end = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imse = end.getItemMeta();
- imse.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "EnderMan's Soul");
- imse.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- end.setItemMeta(imse);
- ItemStack spi = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imss = spi.getItemMeta();
- imss.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Spider's Soul");
- imss.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- spi.setItemMeta(imss);
- ItemStack spq = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imsq = spq.getItemMeta();
- imsq.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Squid's Soul");
- imsq.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- spq.setItemMeta(imsq);
- ItemStack spw = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imsw = spw.getItemMeta();
- imsw.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Wolf's Soul");
- imsw.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- spw.setItemMeta(imsw);
- ItemStack spc = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imscc = spc.getItemMeta();
- imscc.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Chicken's Soul");
- imscc.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- spc.setItemMeta(imscc);
- ItemStack spb = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imsb = spb.getItemMeta();
- imsb.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Blaze's Soul");
- imsb.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- spb.setItemMeta(imsb);
- ItemStack spl = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imsl = spl.getItemMeta();
- imsl.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Llama's Soul");
- imsl.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- spl.setItemMeta(imsl);
- ItemStack spr = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imsr = spr.getItemMeta();
- imsr.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Rabbit's Soul");
- imsr.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- spr.setItemMeta(imsr);
- ItemStack spo = new ItemStack(Material.DRAGONS_BREATH);
- ItemMeta imso = spo.getItemMeta();
- imso.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Ocelot's Soul");
- imso.setLore(Arrays.asList(ChatColor.GOLD + "Click right click on a block",ChatColor.GOLD + "to release mob's soul ", ChatColor.GOLD + "and spawn it!"));
- spo.setItemMeta(imso);
- if (player instanceof Player && player.getInventory().getItemInMainHand().getType().equals(Material.GLASS_BOTTLE)) {
- if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.AQUA + "Soul Catcher")) {
- if (player.getInventory().getItemInMainHand().getAmount() >= 2) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.RED + "You cannot use this item stacked,please use it one by one!");
- } else {
- if (killed.getType().equals(EntityType.COW)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught cow's soul!");
- player.getInventory().setItemInMainHand(cow);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- } else if (killed.getType().equals(EntityType.PIG)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught pig's soul!");
- player.getInventory().setItemInMainHand(pig);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.SKELETON)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught skeleton's soul!");
- player.getInventory().setItemInMainHand(skel);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.ZOMBIE)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught zombie's soul!");
- player.getInventory().setItemInMainHand(zom);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.CREEPER)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught creeper's soul!");
- player.getInventory().setItemInMainHand(cre);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.ENDERMAN)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught enderman's soul!");
- player.getInventory().setItemInMainHand(end);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.SPIDER)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught spider's soul!");
- player.getInventory().setItemInMainHand(spi);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.SQUID)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught squid's soul!");
- player.getInventory().setItemInMainHand(spq);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.WOLF)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught wolf's soul!");
- player.getInventory().setItemInMainHand(spw);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.CHICKEN)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught chicken's soul!");
- player.getInventory().setItemInMainHand(spc);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.BLAZE)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught blaze's soul!");
- player.getInventory().setItemInMainHand(spb);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.LLAMA)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught Llama's soul!");
- player.getInventory().setItemInMainHand(spl);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.RABBIT)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught Rabbit's soul!");
- player.getInventory().setItemInMainHand(spr);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- }else if (killed.getType().equals(EntityType.OCELOT)) {
- player.sendMessage(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "You caught Ocelot's soul!");
- player.getInventory().setItemInMainHand(spo);
- player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 2F, 1F);
- e.getDrops().clear();
- e.setDroppedExp(0);
- } else {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "This mob's soul cannot be taken." );
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "1. His soul cannot be taken because it is too op! Or" );
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "2. The developer was lazy and forgot about this mob..." );
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "He will fix it in next update (maybe...)" );
- }
- }
- }
- }
- }
- //Summon System
- @EventHandler
- public void onPlayerInteract(PlayerInteractEvent e) {
- Player player = e.getPlayer();
- ItemStack SoulCatcher = new ItemStack(Material.GLASS_BOTTLE, 1);
- ItemMeta im2 = SoulCatcher.getItemMeta();
- im2.setDisplayName(ChatColor.BOLD + "" + ChatColor.AQUA + "Soul Catcher");
- im2.setLore(Arrays.asList(ChatColor.GOLD + "Kill mob with this item",ChatColor.GOLD + "to catch his souls!", ""));
- SoulCatcher.setItemMeta(im2);
- ItemStack broken = new ItemStack(Material.GLASS_BOTTLE, 1);
- ItemMeta im3 = broken.getItemMeta();
- im3.setDisplayName(ChatColor.BOLD + "" + ChatColor.GRAY + "Broken Soul Catcher");
- im3.setLore(Arrays.asList(ChatColor.GOLD + "Use /howtofix",ChatColor.GOLD + "to learn how to fix the", ChatColor.GOLD + "Soul Catcher!"));
- broken.setItemMeta(im3);
- Random rand = new Random();
- int n = rand.nextInt(100) + 1;
- if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
- if (player.getInventory().getItemInMainHand().getItemMeta() != null) {
- if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName() != null) {
- if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Cow's Soul")) {
- if (n<=50) {
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.COW);
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- }else {
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.COW);
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- }
- } else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Pig's Soul")) {
- if (n<=50) {
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.PIG);
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- }else {
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.PIG);
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- }
- }
- else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Skeleton's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.SKELETON);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.SKELETON);
- }
- }else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Zombie's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.ZOMBIE);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.ZOMBIE);
- }
- }else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Creeper's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.CREEPER);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.CREEPER);
- }
- }else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "EnderMan's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.ENDERMAN);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.ENDERMAN);
- }
- }else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Spider's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.SPIDER);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.SPIDER);
- }
- }else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Squid's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.SQUID);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.SQUID);
- }
- }else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Wolf's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.WOLF);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.WOLF);
- }
- }else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Chicken's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.CHICKEN);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.CHICKEN);
- }
- }else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Blaze's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 1, 0), EntityType.BLAZE);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 1, 0), EntityType.BLAZE);
- }
- }else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Llama's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.LLAMA);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.LLAMA);
- }
- }else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Rabbit's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.RABBIT);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.RABBIT);
- }
- }else if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Ocelot's Soul")) {
- if (n<=50) {
- player.getInventory().setItemInMainHand(broken);
- player.playSound(player.getLocation(), Sound.ENTITY_SPLASH_POTION_BREAK, 2F, 1F);
- player.sendMessage(ChatColor.RED + "You were unlucky, you broke the Soul Catcher!");
- player.sendMessage(ChatColor.RED + "Remember, you have 50% to break the Soul Catcher.");
- player.sendMessage(ChatColor.RED + "Use /howtofix to learn how to fix the SoulCatcher!");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.OCELOT);
- }else {
- player.getInventory().setItemInMainHand(SoulCatcher);
- player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2F, 1F);
- player.sendMessage(ChatColor.GOLD + "You were lucky, you didn't broke the Soul Catcher!");
- player.sendMessage(ChatColor.GOLD + "But remember, you have 50% to break the Soul Catcher.");
- player.getWorld().spawnEntity(e.getClickedBlock().getLocation().add(0, 2, 0), EntityType.OCELOT);
- }
- }
- }
- }
- }
- }
- //Commands
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if (cmd.getName().equals("soul")) {
- if (sender instanceof Player) {
- Player player = (Player) sender;
- if (player.hasPermission("soulcatcher.commands")) {
- ItemStack SoulCatcher = new ItemStack(Material.GLASS_BOTTLE, 1);
- ItemMeta im2 = SoulCatcher.getItemMeta();
- im2.setDisplayName(ChatColor.BOLD + "" + ChatColor.AQUA + "Soul Catcher");
- im2.setLore(Arrays.asList(ChatColor.GOLD + "Kill mob with this item",ChatColor.GOLD + "to catch his souls!", ""));
- SoulCatcher.setItemMeta(im2);
- player.getInventory().addItem(SoulCatcher);
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment