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
| Edition | Syntax |
|---|---|
| Java | schedule function <function> <time> [append|replace] OR schedule clear <function> |
| Bedrock | schedule 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 100Java: run the function in 100 ticks (5 seconds)
/schedule function mypack:timer 20sJava: run in 20 seconds
/schedule delay add myfunction 200Bedrock: run myfunction in 200 ticks
Tips
- A function that schedules itself is a repeating timer - remember a way to stop it.
- append queues another execution; replace (default) overwrites the pending one.
- Java times are in ticks by default; add s for seconds or d for days.