Solved Inventory Slot

Discussion in 'Plugin Help/Development/Requests' started by bubblefat_, Jan 3, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    bubblefat_

    Ok so I made one of those thinks where you right click a compass and an inventory pops up with things inside of it. Well I am trying to figure out how to choose what slot it goes in. I tried adding "air" between each and adding .setItem(3, item); But I can't figure it out.

    Code:
    {
                ItemStack item = new ItemStack(Material.DIAMOND_SWORD, 1);
                ItemMeta meta = item.getItemMeta();
                meta.setDisplayName(ChatColor.WHITE + "§lKit PvP");
                List<String> lore = new ArrayList<String>();
                lore.add(ChatColor.GRAY + "Some Lore");
                meta.setLore(lore);
                item.setItemMeta(meta);
                inv.addItem(item);
            }
     
  2. Offline

    xMakerx

    If you already solved this, ignore this post.

    You can create AIR slots by creating a new ItemStack with the AIR material like so:

    Code:
    ItemStack air = new ItemStack(Material.AIR);
     
Thread Status:
Not open for further replies.

Share This Page