Minecraft /schedule command

Java EditionBedrock EditionSince Java 1.14 (18w43a) / Bedrock 1.16.100

Quick answer: Delays the execution of a function by a set amount of time or until an area loads. Syntax: schedule function <function> <time> [append|replace] OR schedule clear <function>

/schedule runs a function later instead of immediately: after N ticks or seconds (Java: tick unit with optional 's' suffix; Bedrock: delay add with a time), or when a region finishes loading (Bedrock's on_area_loaded). Use schedule clear to cancel a queued function. It is the standard way to build timers, loops and delayed events in data packs and add-ons.

Syntax

EditionSyntax
Javaschedule function <function> <time> [append|replace] OR schedule clear <function>
Bedrockschedule delay add <function: filepath> <time: int> [append|replace] OR schedule on_area_loaded add ... OR schedule clear <function: filepath>

Targets / arguments: Functions from data packs (Java) or behavior packs (Bedrock). Requires: Cheats enabled / operator level 2 (Java), 1 (Bedrock).

Examples

/schedule function mypack:open_gates 100

Java: run the function in 100 ticks (5 seconds)

/schedule function mypack:timer 20s

Java: run in 20 seconds

/schedule delay add myfunction 200

Bedrock: run myfunction in 200 ticks

Tips

Related commands

/function/execute