Inventory Spot

Discussion in 'Spigot Help' started by LazerShadow, May 25, 2015.

  1. How do I set the spot that the item is in the inventory?

    Code:
    Code (Text):
        public static Inventory getStarInventory() {
       
            Inventory inv = Bukkit.createInventory(null, 27, "§lSelect your Kit!");
           
            {
                ItemStack item = new ItemStack(Material.ANVIL, 1);
                ItemMeta meta = item.getItemMeta();
                meta.setDisplayName(ChatColor.GREEN + "§lPlayer Kits");
                List<String> lore = new ArrayList<String>();
                lore.add("§7These are all the player kits that you get from");
                lore.add("§7joining the server!");
                lore.add(" ");
                lore.add("§cYou can't add green wool like normal,");
                lore.add("§conce I know how I will change to green wool");
                meta.setLore(lore);
                item.setItemMeta(meta);
                inv.addItem(item);
                   
            }
           
           
            {
                ItemStack item = new ItemStack(Material.IRON_CHESTPLATE, 1);
                ItemMeta meta = item.getItemMeta();
                meta.setDisplayName(ChatColor.GREEN + "§lKnight");
                List<String> lore = new ArrayList<String>();
                lore.add("§7The Knight is the classic Minecraft warrior. He doesn't");
                lore.add("§7have any special abilities, although he has generally");
                lore.add("§7better armour then other players and more health!");
                meta.setLore(lore);
                item.setItemMeta(meta);
                inv.addItem(item);
                   
            }
           
            {
                ItemStack item = new ItemStack(Material.AIR, 1);
                inv.addItem(item);
                   
            }
           
            {
                ItemStack item = new ItemStack(Material.DIAMOND_SWORD, 1);
                ItemMeta meta = item.getItemMeta();
                meta.setDisplayName(ChatColor.GREEN + "§lAssassin");
                List<String> lore = new ArrayList<String>();
                lore.add("§7The assassin is a very strong in strength, although he");
                lore.add("§7has one weakness: He has bad armor! Fortunately for him");
                lore.add("§7his strength makes up for it");
                meta.setLore(lore);
                item.setItemMeta(meta);
                inv.addItem(item);
                   
            }
           
            return inv;
        }
       
        public static Location getTarget(){
            return targetPoint;
        }
       
        public static void setTarget(Location loc) {
            Main.targetPoint=loc;
        }
     
  2. inv.setItem(spot, ItemStack);