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

Delay a task

Discussion in 'Help' started by DiamondGamer30, Oct 31, 2017.

  1. DiamondGamer30

    DiamondGamer30 Baby Zombie

    Messages:
    175
    GitHub:
    diamondgamermcpe
    Can anyone tell me how I can delay a task?
     
  2. Irish

    Irish Baby Zombie

    Messages:
    156
    GitHub:
    irishpacks
    There's a function ServerScheduler::scheduleDelayedRepeatingTask() (accessible through Server::getScheduler()) for that with the parameters being the task, the delay, and the length between each execution respectively. See this page on how to schedule tasks.
     
    Last edited: Nov 1, 2017
  3. DiamondGamer30

    DiamondGamer30 Baby Zombie

    Messages:
    175
    GitHub:
    diamondgamermcpe
    How about a task thats not repeating?
     
  4. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    simply use scheduleDelayedTask
     
    Irish likes this.
  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.