Solved Having a problem with my BukkitRunnable need help

Discussion in 'Spigot Plugin Development' started by ImJustHere, Feb 18, 2020.

  1. for same reason the timer is going like this 4, 2, 0
    and not like this 5, 4, 3, 2, 1, 0 and I did try 20 20 but get the same result I think I just messed up with the ticks
    Code (Text):
        public void MMGameStart()
        {
            new BukkitRunnable()
            {
                @Override
                public void run()
                {
                    if(Manager.Bystanders.size() == Manager.Size) {
                        for(UUID pl : Manager.Bystanders)
                        {
                            if(Left > -1) {
                                 Bukkit.getPlayer(pl).spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', "&a&l" + Left)));
                                 Bukkit.getPlayer(pl).playSound(Bukkit.getPlayer(pl).getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 20.0F, 20.0F);
                                 Left--;
                            }
                         
                        }
                    }

                }
            }.runTaskTimer(this, 30, 60);
        }
     
    #1 ImJustHere, Feb 18, 2020
    Last edited: Feb 18, 2020
  2. You’re subtracting one for each player on the server. So you’re testing with 2 players right now.
     
  3. ohh right ik i missed something thx you