DatapackJavaBedrock

/schedule

Queues a datapack function to run after a delay measured in game ticks, seconds, or days. append keeps any existing schedule for that function; replace (default) overwrites it. The standard way to build timers and loops inside datapacks.

Syntax

Alternate forms:

Parameters

function
function ID
Function to schedule.
time
duration
Delay, e.g. 100t, 20s, or 1d.
modeoptional
literal
append or replace (default replace).

Examples

  • Run mypack:tick after 20 ticks (1 second).

  • Self-scheduling loop every 5 seconds.

Permission level

/schedule requires Cheats (op level 2). In single-player you need the world's "Allow Cheats" toggle on. On a multiplayer server you need to be opped — see /op.