Skip to content

worldStateChanged

Tells your gamemode that the clock, the weather, a world rule or the players’ marker settings changed, by your gamemode or anything else.

Renamed in 0.28 from worldChange; see renamed names.

server.on("worldStateChanged", ({ clock, weather, rules, playerMarkers }) => void)
Name Type Description
clock { hours: number; minutes: number; minuteStartedAtUnixMs: number } The clock; minuteStartedAtUnixMs is when that game minute began, in Unix milliseconds.
weather number The weather type, 0 to 22.
rules Partial<Record<WorldRuleName, boolean>> Every world rule and whether it’s on.
playerMarkers PlayerMarkerSettings The players’ radar markers: { mode, radius, radarScale }; radius: null means no limit, radarScale is the game’s blip size, 1-16.
gamemodes/my-mode.ts
import { server } from "nativemp";
server.on("worldStateChanged", ({ playerMarkers }) => {
server.log(`Markers: ${playerMarkers.mode}, radius ${playerMarkers.radius ?? "no limit"}, scale ${playerMarkers.radarScale}`);
});