Solved runTaskTimerAsynchronously Not Running

Discussion in 'Spigot Plugin Development' started by Spedwards, May 29, 2016.

  1. So I'm trying to create a ticker that runs all the time, though it currently isn't working and from the examples I've seen, I can't figure out why. Below is a stripped down version of my main class. Is anyone able to let me know what's wrong and what I can do to fix it?

    Code (Text):
    public class Main extends JavaPlugin {
       
        public static final Logger log = Logger.getLogger("Minecraft");
       
        @Override
        public void onEnable() {
            Bukkit.getServer().getScheduler().runTaskTimerAsynchronously(this, new Runnable() {
                @Override
                public void run() {
                    log.finer("Tick");
                }
            }, 10L, 1000L);
        }
       
    }
     
  2. use a BukkitRunnable
     
  3. Thanks.

    For those also having this issue, below is my code now:

    Code (Text):
    public class Main extends JavaPlugin {
     
        public static final Logger log = Logger.getLogger("Minecraft");
     
        @Override
        public void onEnable() {
            BukkitRunnable runnable = (new BukkitRunnable() {
                @Override
                public void run() {
                    log.finer("Tick");
                }
            });
            runnable.runTasktimerAsynchronously(this, 5L, 20L);
        }
     
    }
     
  4. any error with ?

    if there's no set the prefix to solved.