Ok, so recently I have been developing a kitGUI for a server. And they specified that they needed a timer to be displayed on the lore of the item within the GUI. So far I have accomplished at succeeding with adding the player to a player arraylist and checking if they are in that arraylist and if they are not they can click on the item and it will give them their kit. But I want it to display how long its got left until they can use that kit again!
@EventHandler public void onInvClick(InventoryClickEvent e){ // Name of who clicked String clicked = e.getWhoClicked().getName(); final Player p = (Player) e.getWhoClicked(); // ------------------ if (e.getInventory().getName() != "§8[§b§lKITS§8]"){ return; } if (e.getCurrentItem().getItemMeta().getDisplayName().contains("§8[§bTrooper§8]")){ e.setCancelled(true); if(!cooldownTime.containsKey(p)) { trooperKit(clicked, p); e.getWhoClicked().closeInventory(); } cooldown.add(p); Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() { public void run() { cooldown.remove(p); } }, 200); } }