Advertisement
HaniiPuppy

countdown usage

Jan 2nd, 2014
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. CountDown countdown = new CountDown([the plugin object], [the number counting down from], [the number of ticks per count])
  2. {
  3.     @Override
  4.     protected void onCount(CountDown countDown, int currentCount)
  5.     {
  6.         if(currentCount == 1)
  7.             for(Player player : Bukkit.getOnlinePlayers())
  8.                 player.sendMessage("One minute to go!");
  9.  
  10.         // Any other per-count code.
  11.     }
  12.  
  13.     @Override
  14.     protected void onFinish(CountDown countDown)
  15.     {
  16.         for(Player player : Bukkit.getOnlinePlayers())
  17.             player.sendMessage("Ta-da!!");
  18.     }
  19. };
  20.  
  21. countdown.run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement