SixL client API / game/clock / GameClockMp

Interface: GameClockMp

The game's clock and calendar. The game's own time runs on its own, and a script may set or advance it.

Remarks

Every getter returns a Promise. Hours are 0..23, minutes and seconds 0..59.

Methods

addToClockTime()

addToClockTime(hours, minutes, seconds): void

Adds a span of time to the game clock.

Parameters

hours

number

Hours to add.

minutes

number

Minutes to add.

seconds

number

Seconds to add.

Returns

void

Example

mp.game.clock.addToClockTime(0, 30, 0);

addToTime()

addToTime(hours, minutes, seconds): void

The same as GameClockMp.addToClockTime.

Parameters

hours

number

Hours to add.

minutes

number

Minutes to add.

seconds

number

Seconds to add.

Returns

void

Example

mp.game.clock.addToTime(0, 30, 0);

advanceClockTimeTo()

advanceClockTimeTo(hour, minute, second): void

Moves the game time forward to a given time of the day. It does not go back.

Parameters

hour

number

Hour, 0..23.

minute

number

Minute, 0..59.

second

number

Second, 0..59.

Returns

void

Example

mp.game.clock.advanceClockTimeTo(18, 30, 0);

advanceTimeTo()

advanceTimeTo(hour, minute, second): void

The same as GameClockMp.advanceClockTimeTo.

Parameters

hour

number

Hour, 0..23.

minute

number

Minute, 0..59.

second

number

Second, 0..59.

Returns

void

Example

mp.game.clock.advanceTimeTo(18, 30, 0);

getDayOfMonth()

getDayOfMonth(): Promise<number>

The current game day of the month.

Returns

Promise<number>

A Promise of the day of the month, 1..31.

Example

const day = await mp.game.clock.getDayOfMonth();

getDayOfWeek()

getDayOfWeek(): Promise<number>

The current game day of the week.

Returns

Promise<number>

A Promise of the day, an integer in the game's own numbering.

Example

const weekday = await mp.game.clock.getDayOfWeek();

getHours()

getHours(): Promise<number>

The current game hour.

Returns

Promise<number>

A Promise of the hour, 0..23.

Example

const hour = await mp.game.clock.getHours();

getMillisecondsPerGameMinute()

getMillisecondsPerGameMinute(): Promise<number>

How many real milliseconds one game minute lasts.

Returns

Promise<number>

A Promise of the duration of a game minute, in milliseconds.

Example

const ms = await mp.game.clock.getMillisecondsPerGameMinute();

getMinutes()

getMinutes(): Promise<number>

The current game minute.

Returns

Promise<number>

A Promise of the minute, 0..59.

Example

const minute = await mp.game.clock.getMinutes();

getMonth()

getMonth(): Promise<number>

The current game month.

Returns

Promise<number>

A Promise of the month, 1..12.

Example

const month = await mp.game.clock.getMonth();

getSeconds()

getSeconds(): Promise<number>

The current game second.

Returns

Promise<number>

A Promise of the second, 0..59.

Example

const second = await mp.game.clock.getSeconds();

getYear()

getYear(): Promise<number>

The current game year.

Returns

Promise<number>

A Promise of the full year, for example 2026.

Example

const year = await mp.game.clock.getYear();

pause()

pause(toggle): void

The same as GameClockMp.pauseClock.

Parameters

toggle

boolean

true to pause the clock, false to let it run.

Returns

void

Example

mp.game.clock.pause(false);

pauseClock()

pauseClock(toggle): void

Stops or starts the game clock.

Parameters

toggle

boolean

true to pause the clock, false to let it run.

Returns

void

Example

mp.game.clock.pauseClock(true);

setClockDate()

setClockDate(day, month, year): void

Sets the game date.

Parameters

day

number

Day of the month, 1..31.

month

number

Month, 1..12.

year

number

Full year, for example 2026.

Returns

void

Example

mp.game.clock.setClockDate(1, 7, 2026);

setClockTime()

setClockTime(hour, minute, second): void

Sets the game time to a given hour, minute and second.

Parameters

hour

number

Hour, 0..23.

minute

number

Minute, 0..59.

second

number

Second, 0..59.

Returns

void

Example

mp.game.clock.setClockTime(12, 0, 0);

setDate()

setDate(day, month, year): void

The same as GameClockMp.setClockDate.

Parameters

day

number

Day of the month, 1..31.

month

number

Month, 1..12.

year

number

Full year, for example 2026.

Returns

void

Example

mp.game.clock.setDate(1, 7, 2026);

setTime()

setTime(hour, minute, second): void

The same as GameClockMp.setClockTime.

Parameters

hour

number

Hour, 0..23.

minute

number

Minute, 0..59.

second

number

Second, 0..59.

Returns

void

Example

mp.game.clock.setTime(12, 0, 0);