![]() |
VOOZH | about |
/schedule| Permission level required |
|
|---|---|
| Restrictions | Cheat only[BE only] |
{
"title": "<code>/schedule</code>",
"rows": [
{
"field": "\n* 2 <sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Java Edition\">(link to Java Edition article, displayed as JE) only</span></i>]</sup>\n* 1 <sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as BE) only</span></i>]</sup>",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "(link to Cheat article, displayed as Cheat) only<sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as BE) only</span></i>]</sup>",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Schedules the function(s).
In Java Edition, delays the execution of a function or all functions in a function tag. The function(s) are executed by the server after specified amount of time passes.
In Bedrock Edition, schedules a function to be executed once an area is fully loaded, or after a certain amount of time.
In Java Edition, the same functions or the same function tags cannot have two schedules executed at the same game tick.
In Java Edition, 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 world spawn.
schedule function <function> <time> [append|replace]
schedule clear <function>
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>
schedule delay add <function> <delay (ticks)> [append|replace]schedule delay clear <function>
schedule clear <function: filepath>schedule on_area_loaded clear function <function: filepath>schedule on_area_loaded clear tickingarea <name: string> [function: filepath]
JE: <function>: function
BE: function: filepath: CommandFilePath
#, which resolves into a function or a function tag during command execution. In Bedrock Edition, must be of the format path/to/function/file, which resolves into a function located at [behavior_pack]/functions/path/to/function/file.mcfunction during command execution.d: an in-game day, 24000 gameticks;s: a second, 20 gameticks;t (default and omitable): a single gametick; the default unit..5d is same as 12000 gameticks.1t does NOT always mean one tick of delay. Instead, it schedules the function for the upcoming phase for scheduled functions.
schedule function <function> 1t is executed in #minecraft:tick functions, it schedules the function for the phase in the same tick, which comes right after the phase for the #minecraft:tick functions.schedule function <function> 1t is executed during the "scheduled functions" phase, it schedules the function for the next phase, which is coming in the next tick.1t in #minecraft:tick functions makes the function run within the same tick, and specifying 1t in scheduled functions makes the function run in the next tick.JE: <function>: string (in /schedule clear ... mode)
minecraft: cannot be omitted) or a function tag(minecraft: cannot be omitted).JE: append|replace
replace — (default) Simply replaces the current function's schedule time.append — Allows multiple schedules to exist at different times.BE: from: x y z: CommandPosition and to: x y z: CommandPosition
<X>, <Y> and <Z>, each of which must be a single-precision floating-point number or tilde and caret notation.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.BE: center: x y z: CommandPosition
<X>, <Y> and <Z>, each of which must be a single-precision floating-point number or tilde and caret notation.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.BE: name: string: basic_string
\ can be used to escape characters).| Command | Trigger | Java Edition | Bedrock Edition |
|---|---|---|---|
| Any | The command is incomplete, or any argument is not specified correctly. | Unparseable | Unparseable |
| The specified function or function tag does not exist. | Failed | Failed | |
/schedule function ... | <time> is 0. | N/A | |
/schedule clear ... | Schedule for <function> can't be found. | ||
/schedule on_area_loaded add <from: x y z> <to: x y z> ... | More than 2,147,483,647 chunks are specified. | N/A | Failed |
/schedule on_area_loaded add circle ... | radius: int is lower than 0. | ||
| Any | Otherwise | Successful | |
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On fail | 0 | 0 | 0 |
/schedule function ... | On success | 1 | 1 | The game tick the function is to execute at modulo 2147483647 | |
/schedule clear ... | On success | 1 | 1 | the number of schedules that are cleared. | |
| Bedrock Edition | On fail | 0 | N/A | N/A | |
| On success | 1 | N/A | N/A |
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.14 | 18w43a | Added /schedule. | |||||
| 1.15 | 19w38a | Added a clear syntax and added an append/replace optional argument (defaults to replace). | |||||
| Bedrock Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.16.100 | beta 1.16.100.59 | Added /schedule.
| |||||
| The command itself works differently from Java Edition. | |||||||
| 1.21.40 | Preview 1.21.40.20 | Added new overloads allows you to clear a queued function. | |||||
/schedule Command" – Microsoft Learn, October 9, 2024.