Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheatsAll commands

Switch game

23 Wikis · pick your game
/schedule

Command

/schedule

Runs a function, or all functions in a function tag, after a delay, or cancels a scheduled function.

Syntax

/schedule clear <function>
/schedule function <function> <time> [(append|replace)]

Arguments

ArgumentKind of valueWhat to type
<function>IdFor schedule function: the id of the function to run, or a function tag written with a leading #. For schedule clear: the id of the scheduled function to cancel.
<time>TimeHow long to wait, counted from now. A number with an optional unit: t (ticks, default), s (seconds) or d (in-game days). Must be at least 1 tick. At least 0.

Details

Permission level2: operators, worlds with cheats on, command blocks and functions
Works inSingleplayer with cheats enabled, multiplayer servers, command blocks and functions. Needs permission level 2 (gamemasters): operators, players in a world with cheats enabled, command blocks and functions.
Resultschedule function reports "Scheduled function ... in N tick(s) at gametime T" (or "Scheduled tag ...") and returns the game time, in ticks, at which it will run. schedule clear reports "Removed N schedule(s) with ID ..." and returns the number of schedules removed.
Time unitsThe time is a number followed by a unit: t for ticks (also the default when no unit is written), s for seconds (20 ticks) and d for in-game days (24000 ticks). Decimals are allowed and are rounded to whole ticks, for example 1.5s is 30 ticks.
No zero delayA time of 0 fails with "Can't schedule for current tick". The shortest delay is 1 tick.
replace and appendreplace is the default: any existing schedule of the same function or tag is removed and only the new one remains. append keeps the existing schedules and adds another one, so the function can run several times. Two schedules of the same function for the exact same tick count as one.
Function tagsWrite a # before the id to schedule every function in a function tag, for example #mypack:waves.
MacrosA function that uses macro lines cannot be scheduled: "Can't schedule a macro".
clearschedule clear removes all pending schedules of the given function id. If there are none it fails with "No schedules with ID ...". The argument is a plain id; it does not accept the # form.
Schedules are savedPending schedules are stored with the world and survive closing and reopening it.

Examples

/schedule function mypack:start 5s

Runs the function mypack:start 5 seconds from now.

/schedule function mypack:tick_slow 100t

Runs the function 100 ticks (5 seconds) from now, replacing any earlier schedule of it.

/schedule function mypack:reminder 30s append

Adds another run in 30 seconds without removing schedules that already exist.

/schedule function #mypack:waves 1d replace

Runs every function in the tag mypack:waves one in-game day (20 minutes) from now.

/schedule clear mypack:start

Cancels all pending runs of the function mypack:start.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)