So I was trying out some things with Timers for an update to one of my plugins and I was wondering if there is a way to pause a timer from within itself via an if loop.
I tried it and I got a ConcurrentModificationException so was wondering if there is a very specific way I need to do it to avoid that.
I tried making the timer a field and using a second method called inside the timer to pause it but got the exception again.
What I have now and works is to save the ID of the timer as a field and then use the Timer.killTimer(timerID) method, then create the timer again after I am done with whatever I wanted to do while it was stopped.