Skip to content
Advertisement

Repeating Task In Java

I need to repeat a task every 5 seconds in java, I’m creating a minecraft bukkit / spigot Plugin, so doing it with Java or using the bukkit api would both work great.

Code:

JavaScript

Thanks for the help!

Advertisement

Answer

You can do what is called scheduling a repeating task, this example was pulled from the Bukkit forums.

JavaScript

Simply edit the comment in run with the statement you want to run and it should work fine.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement