Solved Can't read ArrayList in Runnable Scheduler?

Discussion in 'Spigot Plugin Development' started by kinukin, Jan 28, 2020.

  1. I can read the ArrayList in another function but I can't read the ArrayList in a runnable scheduler. Why is that?

    Code (Text):
        @SuppressWarnings("deprecation")
        public void runnable(Player p) {
             healthid = Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(Main.getInstance(), new Runnable() {
                public void run() {
                    System.out.println(Arrays.toString(antilog.toArray()));
                }
            }, 0L, 20);
        }
     
  2. Should just work, what exactly isn't working? how did you define your array?
     
  3. Where have you declared the ArrayList?
     
  4. Marked as solved but no response, it be like that.