0

The first time I'm using /schedule but when I try to call a function using schedule from my main function it only works if I schedule it with 1 tick essentially just calling the function. I just tested it in 1.15 and I guess it is intended, but then what is the /schedule command good for? Sure you can make the function call itself, but I want the function to only be active whilst I call it from the other function to make it more optimized.

Example: schedule function pack:data/animation 10t doesn't work, but schedule function pack:data/animation 1t and schedule function pack:data/animation 10t replace works.

  • Is your main function running every tick? – MegaCrafter10 Jun 22 at 14:52
  • @MegaCrafter10 yes I run the main every tick through the Minecraft tick function – nisse26a Jun 22 at 15:23
0

/schedule is used to delay the execution of a function. If all you want to do is execute a function from another function, I recommend using /function pack:data/animation instead.

Also, running schedule function pack:data/animation 10t from your main function won't work since it's executed every tick. The reason is that the main is re-scheduling the execution of the animation function every tick.

| improve this answer | |
  • I'm of course already calling functions but thank you for clearing up my confusion about the schedule command. Though my other question is still how would I call a function only at certain times and have it then run at a specific tick? Would I have to make the schedule have tags and remove them? That seems pretty inconvenient – nisse26a Jun 22 at 16:47
  • Another option is to use a scoreboard timer. Simply create a scoreboard objective, increase it by 1 each tick, run the command when the timer reaches a specific value, and reset the timer. – MegaCrafter10 Jun 22 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.