I want a warning message before a scheduler is going to run. For example, if the scheduler runs ever 2 minutes, one minute before it runs I want it to broadcast the message. What do I do to get a message that does this?
This the code I have to send a message and execute the task I want to happen. How do I send a message one minute before the scheduler runs?
Code:
public void init(){
Task task = Task.builder().execute(VCLag::execute)
.async().interval(this.core.int, TimeUnit.MINUTES)
.name("plugin - Clear Items").submit(core);
}
public static void execute(){
Sponge.getServer().getBroadcastChannel().send(text);
}