Skip to content

world.setClock

Sets the shared game clock. Every player’s game follows.

world.setClock(hours: number, minutes?: number): Promise<ActionResult>
Name Type Description
hours number 0 to 23.
minutes number Optional, 0 to 59. Defaults to 0.

A promise of an ActionResult: applied once the server has changed it for everyone (also when it already was so), or rejected with vetoed when a server-side rule refused it. Out of range is invalid-clock.

Night for everyone.

gamemodes/my-mode.ts
import { world } from "nativemp";
await world.setClock(22, 0);