My cooldown not works

Discussion in 'Plugin Development' started by ProStriker123, Jun 19, 2014.

Thread Status:
Not open for further replies.
  1. Offline


    Whats the problem?
    with the cooldown?

    ArrayList<Player> cooldown = new ArrayList<Player>();

    public void creeperBlast(PlayerInteractEvent event) {
    final Player player = (Player) event.getPlayer();

    if(event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
    if(player.getItemInHand().getItemMeta().getDisplayName() != null) {
    if(player.getItemInHand().getItemMeta().getDisplayName().contains("§f§l- Creeper Blast -")) {
    player.sendMessage("§8Cooldown> §7Please wait 5 seconds before re-using.");
    return ;

    PotionEffect potionEffect = new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 1, 10);

    player.getWorld().createExplosion(player.getLocation(), 4F);

    player.sendMessage("§6Used> §7You used ability §e§lCreeper Blast§7.");
    Bukkit.getServer().getScheduler().scheduleAsyncDelayedTask((Plugin) this, new Runnable() {
    public void run() {
    }, 40);
  2. Offline


    Save the player's name in a List<String> instead of the Player object.
  3. Offline


    ProStriker123 I don't know the problem. You tell me. Tell us what's wrong so we don't have to guess.
  4. Offline


    Using some code tags to put all that code in would be nice as well.
  5. Offline


    well the problem it when you left click on the object its says its works after when you trying again says cooldown, after 5 sec that i needed its still keeps the cooldown

    its dosent let me to do List<String> any another idea you have?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 9, 2016
  6. Drew1080 I Thought The Bug Was on My Monitor xD [Your Signature]
Thread Status:
Not open for further replies.

Share This Page