gui.addElement(new StaticGuiElement('s', new ItemStack(Material.REDSTONE), 42, // Display a number as the item count click -> { if (click.getEvent().getWhoClicked().getName().equals("Redstone") { click.getEvent().getWhoClicked().sendMessage(ChatColor.RED + "I am Redstone!"); return true; // returning true will cancel the click event and stop taking the item } return false; // returning false will not cancel the initial click event to the gui }, "You can add lines describing this element here!", "The first line is displayed as the displayname,", "any additional ones as the lore!", "Any text the ItemStack had will be overwritten." ));