Page 1 of 1

Coroutines with arguments

Posted: Sun Sep 13, 2020 12:45 am
by baenyth
I'm trying to make a function that keeps on giving coins to a block when hit called keepCoins, and it has an argument called index, which is the index of the block. Since the function is meant to be used on a timer, I'm trying to use coroutines to keep it timed, but there are no functions for coroutine timers with agruments, I checked. I tried putting the argument in the function argument, but that didn't work. Is there any way to run a coroutine with arguments, or do I have to do something else?

Thanks in advance.

Re: Coroutines with arguments

Posted: Sun Sep 13, 2020 11:36 am
by Hoeloe
You absolutely can just provide arguments to Routine.run.