When you add an item to an inventory, specify which slot number to place it in. inventory.setItem(slotnumber, item)
If you are creating the items in the inventory, you must set the item's metadata meta = ItemStack.getItemMeta() meta.setDisplayName("custom name") meta.setLore(<arraylist of lore lines>) search this forum for setlore and itemmeta to learn more. Also check the api docs