runTaskLater in a runTaskTimer?

Discussion in 'Plugin Development' started by qlimax5000, Feb 15, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    qlimax5000

    How can i use a runTaskLater to delay a function in a my runTaskTimer?

    Thanks
    - Benjamin
     
  2. Offline

    TeeePeee

    Just as you would run any task, only inside another one.
     
  3. Offline

    qlimax5000

    TeeePeee
    I get errors when doing just that.
     
  4. Offline

    CubieX

    Con you show some code? And the actual error/stack trace would also be helpful.
     
  5. Offline

    TeeePeee

    qlimax5000
    I'll take a shot in the dark and say that any variables you're trying to pass to it aren't final. You can only access final objects in runtime-created classes eg. Runnables.

    For example if you're trying to get the value of an integer assigned in your not-delayed task, you would have to do
    final int variable = otherVariable;
    So that you could access the variable in the delayed task. There are better ways of doing this but final is the quickest way to do so.
     
Thread Status:
Not open for further replies.

Share This Page