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.

What is /schedule used for?

What /schedule is for

Queues a datapack function to run after a delay measured in ticks, seconds, or days.

When to use /schedule

Build timers and loops in datapacks — a function can re-schedule itself to run on a repeating interval.

Tips for /schedule

append keeps any existing schedule for that function; replace (the default) overwrites it. /schedule clear cancels a pending one.

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).

Command builder

Fill in the options below to generate a ready-to-paste /schedule command.

Function to schedule.

Delay, e.g. 100t, 20s, or 1d.

optional

append or replace (default replace).

Examples

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

  • Self-scheduling loop every 5 seconds.

Common questions

How do I make a repeating loop in a datapack?

Have a function re-schedule itself: end it with /schedule function mypack:loop 20t to run again every second.

What's the difference between append and replace?

append keeps any existing schedule for that function and adds another; replace (the default) overwrites it with the new delay.

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.