public class Common implements Listener { private final Inventory inv; public Common() { // Create a new inventory, with no owner (as this isn't a real inventory), a size of nine, called example inv = Bukkit.createInventory(null, 27, "Common"); // Put the items into the inventory initializeItems(); } // You can call this whenever you want to put the items in public void initializeItems() { inv.setItem(10, createGuiItem(Material.ENCHANTED_BOOK, ChatColor.translateAlternateColorCodes('&', "&7XP Give"))); inv.setItem(12, createGuiItem(Material.ENCHANTED_BOOK, ChatColor.translateAlternateColorCodes('&',"&7JumpBoost"), "UWU")); inv.setItem(14, createGuiItem(Material.ENCHANTED_BOOK, ChatColor.translateAlternateColorCodes('&',"&7Haste"), "UWU")); inv.setItem(16, createGuiItem(Material.ENCHANTED_BOOK, ChatColor.translateAlternateColorCodes('&',"&7Speed"), "UWU")); } // Nice little method to create a gui item with a custom name, and description protected ItemStack createGuiItem(final Material material, final String name, final String... lore) { final ItemStack item = new ItemStack(material, 1); final ItemMeta meta = item.getItemMeta(); // Set the name of the item meta.setDisplayName(name); // Set the lore of the item meta.setLore(Arrays.asList(lore)); item.setItemMeta(meta); return item; } // You can open the inventory with this public void openInventory(final HumanEntity ent) { ent.openInventory(inv); } // Check for clicks on items @EventHandler public void onInventoryClick(final InventoryClickEvent e) { if (!e.getInventory().equals(inv)) return; e.setCancelled(true); final ItemStack clickedItem = e.getCurrentItem(); // verify current item is not null if (clickedItem == null) return; final Player p = (Player) e.getWhoClicked(); if(e.getRawSlot() == 10) { //Click here } } // Cancel dragging in our inventory @EventHandler public void onInventoryClick(final InventoryDragEvent e) { if (e.getInventory().equals(inv)) { e.setCancelled(true); } } }