I need some help i keep getting an error and idk whats going on can someone please help. I think this is whats causing the errors "Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {", but i dont know how to fix it. Spoiler: Error Code (Text): Error:404 Error not found Spoiler: Code Code (Text): public class Main extends JavaPlugin implements Listener{ private static Main plugin; @Override public void onEnable(){ //CoolDown Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() { @Override public void run() { cooldown.handleCooldowns(); } }, 1L, 1L); }
Your plugin variable is null, as shown by this text: EDIT: If you're trying to create a listener while in the main class, just use this instead.
so i would make it like this Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
Yes, if you're creating the scheduler inside of the main class. Just a side note, you may want to learn the basics of Java first before starting on a Spigot/Bukkit plugin. It'll give you a better understanding when you do decide to come back.
You're welcome. If not for anything else, it'll make understanding what you're programming easier. Good luck on your development endeavor.