Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 955 Bytes

README.md

File metadata and controls

39 lines (32 loc) · 955 Bytes

Timers

Features

  • Fast and efficient.
  • Supports both countdowns and timers.

Code Example

public class ExampleTimer extends Timer {

    public ExampleTimer() {
        super(TimerType.COUNTDOWN, "Example");
        setDuration(TimeUnit.SECONDS.toMillis(10));
    }

    @Override
    public void tick() {
        final int minutes = (int) getMinutes(getRemaining());
        final int seconds = (int) getSeconds(getRemaining());
        Bukkit.broadcastMessage("There is " + minutes + " minutes and " + seconds + " seconds remaining.");
    }

    @Override
    public void onStart() {
        Bukkit.broadcastMessage("The countdown has now started");
    }

    @Override
    public void onComplete() {
        Bukkit.broadcastMessage("The countdown is now complete!");
    }
    
}

Contact