VitalCountdownTask
Defines a countdown task within the Vital framework. A countdown task may perform an action that can end after a set countdown.
By default, a countdown task will not be a Spring bean. That means that Vital will not automatically create an instance of it. This is because countdown tasks are also meant to be used by vital-minigames, where each instanced-game may have multiple running countdowns that are not scoped to the entire server.
A countdown task can be marked as "autoStart" to automatically start it when a new instance is created. This functionality is disabled by default.
@VitalCountdownTask.Info(interval = 1_000, countdown = 10, autoStart = false)
public class MyCountdownTask extends VitalCountdownTask.Spigot {
public MyCountdownState(JavaPlugin plugin) {
super(plugin);
}
@Override
public void onTick() {
// ...
}
@Override
public void onExpire() {
// ...
}
}Inheritors
Types
Defines the info for a VitalCountdownTask.
Functions
Cancels the internal runnable for this task.
Cancels the internal task for this task.
Creates the internal runnable for this task.
Creates the internal runnable for this task.
Starts this task if It's not already running. This function will call createRunnable and createTask to set up this task before starting the internal tick timer. The onStart lifecycle function will be called after this task is ready for execution.