All commands
Advanced

/schedule

Run a datapack function after a set amount of time.

Try in Simulator

At a glance

Syntax

Syntax
/schedule function <id> <time>
commandtargetcoordsvaluerequiredoptional

See it

What it does

Runs after a set delay

Anatomy

Every part, explained

  1. 1
    /scheduleCommandRequired

    Schedules a function to run later.

  2. 2
    functionActionRequired

    Use function or clear.

  3. 3
    <id>Function IDRequired

    The function to run, like mypack:loop.

  4. 4
    <time>DelayRequired

    Wait time in ticks (t), seconds (s), or days (d).

Your turn

Try it yourself

Playground
4 tokens · press Enter to run

Copy & paste

Examples

/schedule function mypack:loop 20t

Run after 20 ticks (1 second).

/schedule function mypack:loop 5s

Run after 5 seconds.

/schedule clear mypack:loop

Cancel a scheduled function.

Avoid these

Common mistakes

/schedule mypack:loop 20t
/schedule function mypack:loop 20t

Include the word function before the ID.

/schedule function mypack:loop 20
/schedule function mypack:loop 20t

Add a time unit like t, s, or d.

Keep going

Related commands