Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int timer = 00;
- public static int minutes = 00;
- public static int hours = 00;
- }
- public static void startTimerPlus(Player p) {
- Main.state = GameStates.CHALLENGE;
- taskId = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
- @Override
- public void run() {
- if(Settings.timer <= 10) {
- String msg = "§2Zeit: §6" + Settings.hours + "§2:§6" + Settings.minutes + "§2:§06" + Settings.timer;
- for(Player all : Bukkit.getOnlinePlayers()) {
- all.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(msg));
- }
- } else {
- String msg = "§2Zeit: §6" + Settings.hours + "§2:§6" + Settings.minutes + "§2:§6" + Settings.timer;
- for(Player all : Bukkit.getOnlinePlayers()) {
- all.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(msg));
- }
- }
- if(Settings.timerrun == true) {
- if(Settings.timer == 59) {
- Settings.timer = 0;
- Settings.minutes ++;
- } else if(Settings.minutes == 59) {
- Settings.minutes = 0;
- Settings.hours ++;
- }
- Settings.timer ++;
- } else {
- }
- }
- }, 0L, 20L);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement