Commands/schedule

From Minecraft Wiki
Jump to: navigation, search
Grass Block JE7 BE6.png
This page describes content that may be included in a future update to Bedrock Edition.
These features have appeared in Bedrock Edition development versions, but the full update containing these features has not been released for Bedrock Edition yet.
Dark Oak Sapling JE2 BE2.png
This article is a stub.
You can help by expanding it.
schedule
Restrictions

Operator

First introduced

JE 1.14 (18w43a)
BE 1.16.100 (BE beta 1.16.100.59)

Delays the execution of a function. Executes the function after specified amount of time passes.

Syntax[edit]

  • 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>

Arguments[edit]

JE<function>: function
BE: function: filepath: CommandFilePath

In Java Edition, must be a namespaced ID, which refers to a single function, or one prefixed with a #, which refers to a function tag. In Bedrock Edition, must be of the format path/to/function/file, which refers to a function located at [behavior_pack]/functions/path/to/function/file.mcfunction.
Specify the function to be run.

JE: <time>: time

Must be a time in Minecraft. It must be a single-precision floating point number suffixed with a unit. Units include:
  • d: an in-game day, 24000 gameticks;
  • s: a second, 20 gameticks;
  • t (default and omitable): a single gametick; the default unit.
The time is set to the closest integer tick after unit conversion. For example. .5d is same as 12000 ticks.
Specify the delay time.

JE: <function>: string (in /schedule function ... mode)

Must be a string. And it must be a greedy phrase (taking the rest of the command as the string argument).
Specify the function to be cleared. Should be a namespaced ID (minecraft: cannot be omitted) or a function tag(minecraft: cannot be omitted).

JE: append|replace

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

BE: from: x y z: CommandPosition and to: x y z: CommandPosition

It must be a three-dimensional coordinates composed of <x>, <y> and <z>, each of which must be a floating-point number or tilde and caret notation.
Specify the coordinates of opposite corners of a rectangular area used to define a loaded area.

BE: center: x y z: CommandPosition

It must be a three-dimensional coordinates composed of <x>, <y> and <z>, each of which must be a floating-point number or tilde and caret notation.
Specifies the coordinates of the center point of a circular area used to define a loaded area.

BE: radius: int: int

Must be a 32-bit integer number.
Specifies the radius of a circular loaded area as the number of chunks from the center to the edge of the circle. It must be from 1 to 4.

BE: name: string: basic_string

Must be a string. And it must be either a single word (no spaces) or a quoted string.
Specifies the name of the schedule.

Result[edit]

CommandTriggerJava EditionBedrock Edition
anythe arguments are not specified correctly Unparseable Failed
if the specified functions/function tags do not exist Failed
/schedule function ...if <time> is 0
if specified <function> does not exist
/schedule clear ...if schedule for <function> can't be found
/schedule on_area_loaded add ...if the block volume is greater than 32768 (the equivalent of 8 chunk sections)‌ N/A
anyOn successSets or clears schedule(s) of function.

Output[edit]

CommandEditionSituationSuccess Count/execute store succeess .../execute store result ...
anyJava EditionOn fail000
/schedule function ...On success11The game tick the function is to execute at modulo 2147483647
/schedule clear ...On success11the number of schedules that are cleared.

Notes[edit]

Cannot set two schedules to execute the same function at the same game tick.

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

Scheduling the same function before it is successfully run 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 replaces the original.

History[edit]

Java Edition
1.1418w43aAdded /schedule.
1.1519w38aAdded a clear syntax and added an append/replace optional argument (defaults to replace).
Upcoming Bedrock Edition
1.16.100beta 1.16.100.59Added /schedule.
The command itself works differently from Java Edition