Solved Cooldown with currentTimeMillis()

Discussion in 'Plugin Development' started by idkG0D, Oct 3, 2019.

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


    Basically, i've expended all my time today trying to make that works. When i try to make a cooldown with System.currentTimeMillis() it not work!


    public void onEnable(){
            long left = ((System.currentTimeMillis()/1000) + 60) - (System.currentTimeMillis()/1000);
            if(left > 1){
                Bukkit.getConsoleSender().sendMessage("\n\n§aTime: §b"+left);
            if(left < 1){
                Bukkit.getConsoleSender().sendMessage("\n\n§aTime: §bComplete!");
    i maked a post in stack overflow, spigot forums and no one can help me... Please, can someone help me here?

    ah, he send just one message to my console, but i want to get messages saying woh much time will take to end this cooldown

    Last edited by a moderator: Oct 3, 2019
  2. Offline

    timtower Administrator Administrator Moderator

    @idkG0D It is correct though. The difference is 60.
    And you aren't sending any more things.
Thread Status:
Not open for further replies.

Share This Page