EzCountdownApi (interface)
Public service interface exposed by the plugin: com.skyblockexp.ezcountdown.api.EzCountdownApi
Methods
boolean startCountdown(String name)- Start a configured countdown by name. Returns
trueif started successfully.
- Start a configured countdown by name. Returns
boolean stopCountdown(String name)- Stop a running countdown by name. Returns
trueif stopped.
- Stop a running countdown by name. Returns
Optional<Countdown> getCountdown(String name)- Retrieve a countdown configuration/runtime instance by name.
Collection<Countdown> listCountdowns()- List all countdowns currently known to the plugin.
boolean createCountdown(Countdown countdown)- Create and persist a new countdown configuration. Returns
trueon success.
- Create and persist a new countdown configuration. Returns
boolean deleteCountdown(String name)- Delete a configured countdown by name. Returns
truewhen deleted.
- Delete a configured countdown by name. Returns
Usage example (service lookup):
RegisteredServiceProvider<EzCountdownApi> rsp = Bukkit.getServicesManager().getRegistration(EzCountdownApi.class);
if (rsp != null) {
EzCountdownApi api = rsp.getProvider();
api.createCountdown(myCountdown);
api.startCountdown("myCountdownName");
}
Notes
- Changes made via the API are persisted using the plugin’s
countdowns.ymlstorage. - Methods return boolean flags to indicate success; check plugin logs or events for failure reasons.