To answer some of your questions:
Your if check in your createRootTask() method returns the task when it is not logged in.
(p = Players.getLocal()) == null || !p.isVisible())
Local player == null means it's not loaded, in the odd case it is you still want to check if it's visible. I suspect...