@EventHandler public void Crack(PlayerInteractEvent event) { Player p = event.getPlayer(); Material Drug = Material.RABBIT_FOOT; if(cooldown_crack.contains(p.getUniqueId())) { return; } if(p.getItemInHand() != null && p.getItemInHand().getItemMeta().getDisplayName() != null &&p.getItemInHand().getItemMeta().getDisplayName().equals(Config.CRACK_NAME.getMessage()) && p.getItemInHand().getType() == Drug && event.getAction() == Action.RIGHT_CLICK_AIR) { p.getItemInHand().setAmount(p.getItemInHand().getAmount() - 1); p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 20 * Config.CRACK_COOLDOWN.getInt(), Config.CRACK_AMPLIFIER.getInt())); p.sendMessage(Config.DROGA_ATTIVA.getMessage()); p.playSound(p.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1f, 1f); cooldown_crack.add(p.getUniqueId()); new RemoveCooldown(p.getUniqueId(), cooldown_crack).runTaskLater(plugin, 20L * Config.DROGA_COOLDOWN.getInt()); } }