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

Task

Discussion in 'Development' started by bySentixPE, May 20, 2019.

  1. bySentixPE

    bySentixPE Spider Jockey

    Messages:
    37
    Why does the timer dont start if i use the command /timer ?
    https://paste.ee/p/CLsiR
    Sorry idk how can i put the code here bc its killing your eyes if i copy and paste here
     
    Last edited: May 20, 2019
  2. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    Idk why u don't post the code here and not on some external website
     
  3. bySentixPE

    bySentixPE Spider Jockey

    Messages:
    37
    If you readed my question, you know it.
     
  4. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    Remove $player and $time from the task constructor, they don't do anything

    Line 15
    PHP:
    $this->getScheduler()->scheduleRepeatingTask(new Task($this), 20);
    Line 39
    PHP:
    $this->getPlugin()->getScheduler()->cancelTask($this->getTaskId());
    Also PluginTask does not exist anymore, use pocketmine/scheduler/Task instead
    I recommend you taking a look to the new API
     
    Last edited: May 20, 2019
  5. bySentixPE

    bySentixPE Spider Jockey

    Messages:
    37
    Now i got this error but idk what should i do to fix this

    Cannot declare class Main\Task because the name is already in use in /home/minecraft/plugins/Task/src/Main/Main.php on line 22
    I did this all but yet i got this error and idk what should i do to fix this

    Cannot declare class Main\Task because the name is already in use in /home/minecraft/plugins/Task/src/Main/Main.php on line 22
     
  6. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    Change your task class name or write it like this
    PHP:
    class Task extends pocketmine\scheduler\Task { }
     
  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.