Hey i want to add a Timer for my minigame ^^ which start at 15:00 minutes and ends at 0:00 with task. I want to add the BlockTouchEvent . If a the first player touch a specifical block his name will be display in the chat and the Time will be reduce to 3:00 minutes. At that moment everybody have 3:00 minutes to reach the goal but only the second and third Player will be display . I hope you understood that what i wrote ^^.
This, in my opinion, is more a Plugin Request than a Question. To be honest, you should be able to do the stuff with the Block yourself. That means, you need a Timer. That means, go ahead and use the search bar before posting a new thread.
Try to use CallBackTask. PHP: function onEnable(){$this->minute = 15;}function onTouch(BlockTouchEvent $e){$this->getServer()->getScheduler()->scheduleRepeatingTask(new CallbackTask([$this, "scheduler"]), 1200); //1200 = 20*60}function scheduler(){$this->minute--; //timer start} This is example.have fun!
Use a delayed or repeating task, if you want the time to be available whilst your 'timer' is running then I'd use a repeating task as you can get the task to track how long it's been running. I'd recommend using a delayed task if you only want to cancel events as you can easily manage it if you know what your doing.
And for InteractEvent the search bar is still waiting for you And if you want to learn how to sutract time from your timer, go learn coding, sorry