/schedule
Run a datapack function after a set amount of time.
Overview
What is the /schedule command?
The /schedule command delays running a function until a set number of ticks later โ the command-system equivalent of a timer. You can append to or replace an existing schedule, and clear pending ones.
It's essential for datapacks that need delays, cooldowns, repeating loops, or staged sequences without redstone clocks.
When to use it: Use /schedule to run a function after a delay โ timers, cooldowns, and self-repeating loops in datapacks.
At a glance
Syntax
/schedule function <id> <time>See it
What it does
Anatomy
Every part, explained
- 1
CommandRequired/scheduleSchedules a function to run later.
- 2
ActionRequiredfunctionUse function or clear.
- 3
Function IDRequired<id>The function to run, like mypack:loop.
- 4
DelayRequired<time>Wait time in ticks (t), seconds (s), or days (d).
Your turn
Try it yourself
Copy & paste
Examples
/schedule function mypack:loop 20tRun after 20 ticks (1 second).
/schedule function mypack:loop 5sRun after 5 seconds.
/schedule clear mypack:loopCancel a scheduled function.
Avoid these
Common mistakes
/schedule mypack:loop 20t/schedule function mypack:loop 20tInclude the word function before the ID.
/schedule function mypack:loop 20/schedule function mypack:loop 20tAdd a time unit like t, s, or d.
Good to know
Frequently asked questions
- How do you delay a function in Minecraft?
- Run /schedule function <name> <time>, e.g. /schedule function mypack:loop 100t to run it in 5 seconds.
- How do you make a repeating loop with /schedule?
- Have the function schedule itself at the end, so each run queues the next โ a clean tick-free loop.
- How do you cancel a scheduled function?
- Use /schedule clear <name> to remove a pending schedule before it fires.
Keep going