Hi! Help set this code to cooldown! I need to see if the player pressed, the event was carried out, and if I repeat something let the triggered cooldown! Code: @SuppressWarnings("deprecation") @EventHandler public void click(PlayerInteractEvent e) { Player p = e.getPlayer(); if ((e.getAction() == Action.RIGHT_CLICK_BLOCK) || e.getAction == Action.RIGHT_CLICK_AIR))) { if(p.getInventory().contains(item)) { if(p.isOnGround()) { p.sendMessage("Hello!"); } } } } } }[code]
I've created a resource for cooldowns. Look for it here: https://bukkit.org/threads/cooldowns-prevent-users-from-executing-commands.472167/
Yes. Just add them to the restriction with PHP: cooldownUsers.put(player, System.currentTimeMillis() / 1000L);