Solved Item in the zero slot is not displayed

Discussion in 'Spigot Plugin Help' started by BrightGirl, Jul 10, 2021.

  1. Hello, I have a problem, after I put an item in the inventory on the zero slot it just does not show up. Previously everything was fine, I recently put bungeecord plugin, maybe it interferes with something? The other slots are fine, but I need to put the item in the very first slot, that is, with an index of 0, I do not understand why this happens.
     
  2. Code (Text):
        public static ItemStack createItem(String displayName, List<String> lore, int inventorySlot, Material material, Inventory inventory) {
            ItemStack item = new ItemStack(material);
            ItemMeta meta = item.getItemMeta();
            meta.setDisplayName(displayName);
            meta.setLore(lore);
            item.setItemMeta(meta);
            if(!(inventorySlot < 1)) {
                inventory.setItem(inventorySlot,item);
            }
            return item;
        }

      BuildItem.createItem("ยง4i..", null,0,Material.GOLD_BLOCK,inventory..);
     
  3. May want to change that to 0 instead.
     
    • Like Like x 1
  4. How did I not notice xd thank you
     
    • Informative Informative x 1