Scheduler
Auto-generated from
src/stdlib/scheduler.mcrs— do not edit manually.
API
task_schedule v1.0.0
Schedule slot task_id (0–7) to fire after delay ticks for player p.
fn task_schedule(p: selector, task_id: int, delay: int)Parameters
| Parameter | Description |
|---|---|
p | Recipient player or entity selector |
task_id | Slot index in range [0, 7] |
delay | Number of ticks to wait before firing |
Example
task_schedule(@s, 0, 40)task_cancel v1.0.0
Cancel slot task_id for player p (zeroes the counter).
fn task_cancel(p: selector, task_id: int)Parameters
| Parameter | Description |
|---|---|
p | Recipient player or entity selector |
task_id | Slot index in range [0, 7] |
Example
task_cancel(@s, 0)task_ready v1.0.0
Returns 1 if slot task_id fired on this tick (counter reached 1), 0 otherwise.
Automatically clears the slot once it fires so subsequent calls return 0.
fn task_ready(p: selector, task_id: int) -> intParameters
| Parameter | Description |
|---|---|
p | Player or entity selector to check |
task_id | Slot index in range [0, 7] |
Returns: 1 when the task is ready, 0 otherwise
Example
if (task_ready(@s, 0) == 1) { /* handle event */ }gtask_schedule v1.0.0
Schedule global slot task_id (0–7) to fire after delay ticks.
Global tasks are stored on the #rs fake-player and are not bound to any specific player entity.
fn gtask_schedule(task_id: int, delay: int)Parameters
| Parameter | Description |
|---|---|
task_id | Slot index in range [0, 7] |
delay | Number of ticks to wait before firing |
Example
gtask_schedule(0, 200)gtask_cancel v1.0.0
Cancel global slot task_id by zeroing its counter.
fn gtask_cancel(task_id: int)Parameters
| Parameter | Description |
|---|---|
task_id | Slot index in range [0, 7] |
Example
gtask_cancel(0)gtask_ready v1.0.0
Returns 1 if global slot task_id fired this tick, 0 otherwise.
Automatically clears the slot once it fires.
fn gtask_ready(task_id: int) -> intParameters
| Parameter | Description |
|---|---|
task_id | Slot index in range [0, 7] |
Returns: 1 when the task is ready, 0 otherwise
Example
if (gtask_ready(0) == 1) { /* handle global event */ }scheduler_tick v1.0.0
Decrement all active per-player and global timers by 1 each tick.
Call this inside your @tick function (executed as @a). Counters are clamped to 0 so they never go negative.
fn scheduler_tick()Example
// In your @tick mcfunction:
scheduler_tick()