I want to make some code run every 10 ticks in my Commands class (the trigger is in Commands, and i don't know how to move it to Main). I tried using runTaskTimer() and it says that the method is deprecated, although no errors found. Also, i need the task to cancel itself 10 minutes after start. This is what i was trying to do: Bukkit.getServer().getScheduler().runTaskTimer(Main.getPlugin(Main.class), new BukkitRunnable(){//some code//}) Any help is appreciated, thanks. mods its been 20 hours now EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Code: Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, runnable, initialDelay, repeatingDelay);