Time Events
Estimated reading time: 2 minutesThe TimeEvents module handles time-related events. It allows registering events that trigger at specific times or intervals (e.g. per second, per minute, hourly, daily, monthly) and on time travel.
Use maplebirch.dynamic.regTimeEvent (the underlying manager is maplebirch.dynamic.Time). For legacy “Simple Frameworks” scripts, the global TimeEvent class still bridges to regTimeEvent (see Getting Started).
Game version & v3.2.5
The framework pins GameVersion to >=0.5.9.7. v3.2.5 includes time-event fixes targeting that line; mirror the same constraint in your mod’s dependenceInfo when you rely on these APIs.
Core API
regTimeEvent(type, eventId, options)
Register a new time event.
- @param
type(string): Event type —onSec,onMin,onHour,onDay,onWeek,onMonth,onYear,onBefore,onThread,onAfter,onTimeTravel - @param
eventId(string): Unique event identifier - @param
options(TimeEventOptions): Event configuration - @return
boolean: Whether registration succeeded
delTimeEvent(type, eventId)
Unregister a time event.
timeTravel(options)
Jump game time forward or backward.
