2 tasks in onEnable equals errors for days.

Discussion in 'Spigot Plugin Development' started by NaJated, May 7, 2015.

Thread Status:
Not open for further replies.
  1. Hey all, it pretty much says it in the title, I try to start of 2 tasks in the onEnable and it just leads to errors.

    I also tried putting a task in the player join listener but that just leads to about 100 tasks occurring :)

    JUst need to find a way to do this:

    public void run () {
    for (Player all : Bukkit.getOnlinePlayers()) {

    Could I put it in a separate method then call the method from onEnable?

    EDIT: When I call a runnable method in the onEnable it still gives errors
  2. I would recommend that in your joinevent. Can you post your code ?
  3. Well basicly what I did for the join event is just made a task that is called whenever someone joins but if they leave and rejoin the old task is still running so I need to find a way to cancel that other task before starting a new one. But doing it from onEnable would be mUch much easier cus I could just loop through all players and do it like that :)
  4. Found out a way to do it but would still like to know how to have concurrent tasks executed on the onEnable() Thx <3
  5. Just cancel the old task ? Or use a BukkitRunnable
  6. You don't tell us what you're trying to do, you don't show us any code. You don't give us any error logs. Help us help you?
  7. It's finished :p
Thread Status:
Not open for further replies.