Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/schedule

From SAS Gaming Wiki
Revision as of 15:32, 7 December 2025 by imported>Leo768 (Usage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Infobox command Schedules the function(s).

Usage

Template:IN, delays the execution of a function or all functions in a function Minecraft:tag. The function(s) are executed by the Minecraft:server after specified amount of time passes.

Template:IN, schedules a function to be executed once an area is fully loaded, or after a certain amount of time.

Template:IN, the same functions or the same function tags cannot have two schedules executed at the same game tick.

Template:IN, in replace mode, overrides an unexecuted schedule directly when a function or a function tag already has an unexecuted schedule. For example, if a function is scheduled to be executed in 30 seconds, and before it is executed you want to modify the execution time, you can use replace mode to set a new schedule to replace the original.

Even when using the execute as ... command, the scheduled function always runs as the server at Minecraft:world spawn.

Syntax

  • Java Edition
schedule function <function> <time> [append|replace]
Adds a schedule.
schedule clear <function>
Removes a schedule.
  • Bedrock Edition
schedule on_area_loaded add <from: x y z> <to: x y z> <function: filepath>
schedule on_area_loaded add circle <center: x y z> <radius: int> <function: filepath>
schedule on_area_loaded add tickingarea <name: string> <function: filepath>
Adds a schedule to be executed once an area is loaded.
schedule delay add <function> <delay (ticks)> [append|replace]
schedule delay clear <function>
Delays a schedule.
schedule clear <function: filepath>
schedule on_area_loaded clear function <function: filepath>
schedule on_area_loaded clear tickingarea <name: string> [function: filepath]
Removes a schedule.

Arguments

Template:Argument

Specify the function to be run.
Template:Arg desc

Template:El: Template:Argument

Specify the delay time.
Template:Arg desc
One thing to note is that the delay time of Template:Cd does NOT always mean one tick of delay. Instead, it schedules the function for the upcoming phase for scheduled functions.
  • If Template:Cd is executed in Template:Cd functions, it schedules the function for the phase in the same tick, which comes right after the phase for the Template:Cd functions.
  • If Template:Cd is executed during the "scheduled functions" phase, it schedules the function for the next phase, which is coming in the next tick.
Thus, specifying Template:Cd in Template:Cd functions makes the function run within the same tick, and specifying Template:Cd in scheduled functions makes the function run in the next tick.

Template:El: Template:Argument (in Template:Cd mode)

Specify the function to be cleared. Should be a namespaced ID (minecraft: cannot be omitted) or a function tag(minecraft: cannot be omitted).
Template:Arg desc

Template:El: append|replace

replace — (default) Simply replaces the current function's schedule time.
append — Allows multiple schedules to exist at different times.

Template:El: Template:Argument and Template:Argument

Specifies the coordinates of opposite corners of a rectangular area used to define a loaded area.
Template:Arg desc
For x and z, numbers less than -30,000,000 or greater than 30,000,000 are treated as -30,000,000 or 30,000,000 respectively.

Template:El: Template:Argument

Specifies the coordinates of the center point of a circular area used to define a loaded area.
Template:Arg desc
For x and z, numbers less than -30,000,000 or greater than 30,000,000 are treated as -30,000,000 or 30,000,000 respectively.

Template:El: Template:Argument

Specifies the radius of a circular loaded area as the number of chunks from the center to the edge of the circle.
Template:Arg desc It should be between 0 and 2,147,483,647 (inclusive).

Template:El: Template:Argument

Specifies the name of a ticking area, executes function when which is added.
Template:Arg desc

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Output

Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table

History

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

External links

Navigation

Template:Navbox commands

Minecraft:de:Befehl/schedule Minecraft:es:Comandos/schedule Minecraft:ja:コマンド/schedule Minecraft:pt:Comandos/schedule Minecraft:ru:Команды консоли/schedule Minecraft:zh:命令/schedule