Hello I have a little problem with my plugin. I'd like to do a countdown to the start of my party. Here is how I do: The worry is that it's going too fast. So when the game starts, I only have the one that appears. Otherwise I'm countdown that counts in my console. So I set a delay: The worry is that when the last player joined the party, he remains hang on "Download the land" until the delay .. I do not understand. There is another way to make a delay? Thank you beforehand
@Mathie What you are proably doing is putting the main Thread to sleep. That means NO logic can be processed by Bukkit at all in this period, so for the client it looks like the server is not responding. For making a delay I would suggest a BukkitRunnable, which you can start with "BukkitRunnable#runTaskTimer(Plugin, long, long)". You can cancel that repeating task via "BukkitRunnable#cancel()".
@Mathie The Sheduler is the direct way. It's easier to use a BukkitRunnable and you have the benefit to be able to call "cancel()" in it. Making your own Threads (via Thread#start() or similar) is a very bad Idea, as Bukkit isn't thread safe.
@I Al Istannen @Mathie There's no reason that you can't use a Thread you've created yourself, you just have to abide by the same programming constructs you use when dealing with something the Bukkit server is running asynchronously. That being said, the Bukkit scheduler is a lot more convenient.