Schedulers

Hey,

I’m new at Sponge. I dont unterstand how can i start a scheduler…
I will a scheduler that run all 5 seconds but how can i make one?

I’m very good at Spigot but its different…

Please help <3

//the main class of your plugin with the @plugin annotation
Object plugin = ...; 

Task.builder().interval(5, TimeUnit.SECONDS).execute(
    () -> {
        logger.info("This is called every 5 seconds.");
    }
).submit(plugin);

Check the docs for more information.

Thanks! :slight_smile: I was confused about that