gui.addElement(new DynamicGuiElement('d', (viewer) -> { return new StaticGuiElement('d', new ItemStack (Material.CLOCK), click -> { click.getGui().draw(); // Update the GUI return true; }, "Update time: " + new SimpleDateFormat("HH:mm:ss").format(new Date())); }));