need help with time count!!!

Discussion in 'Spigot Plugin Development' started by OfirTIM, May 11, 2015.

  1. hey... i am OfirTIM :D like i said in my Profile long time ago.. i gonna upload a spigot plugin... soo i need help with little thing... i am making Minecraft Minigame.. and i stuck in the time count like when start the game... and like stop the game in middle for break for players.. then back to game after about 30 secs... the game back to run... but i have the only one problem... i dont remember how to use the time count after every wave and stuff like that... could someone will help me? thanks for answers :D

    Regards, OfirTIM
    • Funny Funny x 1
  2. You can use Schedulers to run tasks after a specific amount of time. If you really want to track time, you can use System.currentTimeMillis() or System.nanoTime() to get the time passed.
    • Like Like x 1
    • Agree Agree x 1
  3. about that.. well i will tell little about my game... its will be 1v1 Mob arena... i just give the name!! soo i need help with the Waves that from wave to wave its will work probably... like i need help with the start of the game that its say ("game starts in" + time + "seconds!")
    and then when the game start its will says ("the game started!!!"),
    and then the waves will work in their time.. like any wave i select how much time its will be... i just need the help with the time and when any one of the things start to work...
  4. Judging from your profile, I'm assuming this is one of your first plugins or that you do not have much experience yet with developing large plugins. If this is true, I highly suggest trying out smaller plugins because minigames, even just Mob Arena, can get very complicated and will be hard to create for beginners.
  5. Sorry if I don't understand what you mean, but I think you can use a BukkitRunnable for this, example:

    Code (Text):
    new BukkitRunnable() {
    public void run() {
    // Code that will run after 30 seconds.
    }.runTaskLater(plugin, 30 * 20); // The time in ticks, or in seconds * 20, since servers run at a tickrate of 20 (unless there is lag!)
  6. i know... i am started acually 3 months ago.. but i still take lessons from my friend... but he has big Exams now... and he has no time to learn me.. soo i try to learn my self... its hard.. but its worth it... if i would get help in any part of this game its would be great... i am sorry that i am make an mastake... just i really wanna start the high away...
  7. thanks you but i just need more little help... when one of the code Running i want to disable them.. and then another code is running... can you tell me what to do?
  8. you know what... i just gonna give up from this MiniGame.. its would not work anyway... thanks for who helped..
    • Winner Winner x 1
  9. It's fine that you're trying to make a plugin. I just suggest that you try working on simpler plugins first because a minigame plugin is complicated to make especially because there are a lot of things you need to make. The timer part is going to be the least of your worries if you try to make a minigame. Look for other plugin ideas that can help you practice first.