world.setClock
Sets the shared game clock. Every player’s game follows.
Signature
Section titled “Signature”world.setClock(hours: number, minutes?: number): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
hours |
number |
0 to 23. |
minutes |
number |
Optional, 0 to 59. Defaults to 0. |
Returns
Section titled “Returns”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.
Example
Section titled “Example”Night for everyone.
import { world } from "nativemp";
await world.setClock(22, 0);Related
Section titled “Related”world.getClock: read itworldStateChanged: it was set