1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Plugin Task errors

Discussion in 'Development' started by Hipster, May 5, 2017.

  1. Hipster

    Hipster Zombie

    Messages:
    214
    Why are there such less task errors? i was using an undeclared function in plugin task and i didnt even knew until i saw, it gave me no errors in console :/
     
  2. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    What plugin task was that? What was the function?
     
  3. Hipster

    Hipster Zombie

    Messages:
    214
    scheduleDelayedRepeatingTask
     
  4. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    There has been changed nothing to PluginTasks lately. Have you even scheduled the task correctly?
     
  5. Hipster

    Hipster Zombie

    Messages:
    214
    PHP:
     $this->getServer()->getScheduler()->scheduleDelayedRepeatingTask(new CoolDownTask($this), 12001200);
    PHP:
    class CoolDownTask extends PluginTask{

        private 
    $plugin;

        public function 
    __construct(Main $plugin){
            
    parent::__construct($plugin);
            
    $this->plugin $plugin;
        }

        public function 
    onRun($tick){
                
    $this->plugin->processCoolDown();
        }

    }
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.