Commands/schedule

From Minecraft Wiki
Jump to: navigation, search
schedule
Restrictions

Operator

First introduced

Java Edition 1.14 (18w43a)

Information icon.svg
This feature is exclusive to Java Edition.

Delays the execution of a function.

Syntax[edit]

schedule function <function> <time> [append|replace]
schedule clear <function>

Arguments[edit]

<function>

Specify the function to be run.

<time>

Specify the delay time in days, seconds, or ticks (default if no specifier).
Follows the form non-negative integer + character (d|s|t|).
Example: 2d specifies two in-game days.
Example: 250 or 250t specifies 250 ticks.

append|replace

Replace simply replaces the current function's schedule time (default).
Append allows multiple schedules to exist at different times.

Result[edit]

Fails if the arguments are of invalid syntax or the function does not exist within a top-level folder in [WORLD_NAME]/datapacks/[DATA_PACK_NAME]/data/[NAMESPACE]/functions. On success, executes the function after specified amount of time passes.

Notes[edit]

Even when using the execute as ... command, the scheduled function always runs as the Server.

Scheduling the same function before it is successfully ran overwrites the previous schedule. If you schedule a function to happen in 5 seconds, then schedule the same function again before the 5 seconds are up, the new schedule will be the one that happens.

History[edit]

Java Edition
1.1418w43aAdded /schedule.
1.1519w38aAdded a clear syntax and added an append/replace optional argument (defaults to replace).