World
constWorld:object
Defined in: client/api.d.ts:1479
The server’s clock, calendar and sky, as this client holds them, and what the sky is doing right now. Read-only: the server’s World, Player.setWeather and Player.setHour set them.
Type Declaration
Section titled “Type Declaration”getDate()
Section titled “getDate()”getDate(): {
day:number;month:number;year:number; } |null
The calendar date the server keeps: the full year, the month 1 to 12, the day of the month.
Returns
Section titled “Returns”{ day: number; month: number; year: number; } | null
Null before the server’s world streams in.
getDaysPassed()
Section titled “getDaysPassed()”getDaysPassed():
number|null
Whole days the server’s clock has run, the game’s GameDaysPassed.
Returns
Section titled “Returns”number | null
Null before the server’s world streams in.
getHour()
Section titled “getHour()”getHour():
number|null
The game hour the server keeps, 0 to 24; the player’s own while a script holds their clock.
Returns
Section titled “Returns”number | null
Null before the server’s world streams in.
getSky()
Section titled “getSky()”getSky(): {
daysPassed:number;full:boolean;hour:number;outgoing:number|null;override:number|null;region:number|null;transition:number;weather:number|null; } |null
What the game’s sky and clock show right now: the weather it is in or fading to, the one it fades from (null once the fade is done), the override it is held to, how far the fade is from 0 to 1, the game’s own hour and day count, whether the whole sky is drawn (outdoors; indoors there is none to fade), and the region whose weathers the sky would roll where the player stands.
Returns
Section titled “Returns”{ daysPassed: number; full: boolean; hour: number; outgoing: number | null; override: number | null; region: number | null; transition: number; weather: number | null; } | null
Null before the game’s data files are loaded.
getTimeScale()
Section titled “getTimeScale()”getTimeScale():
number|null
Game minutes per real minute; 0 holds the clock, as it is while a script holds the player’s own hour.
Returns
Section titled “Returns”number | null
Null before the server’s world streams in.
getWeather()
Section titled “getWeather()”getWeather():
number|null
The TESWeather form ID the server holds the sky to: the player’s own while a script gave them one, else the World’s.
Returns
Section titled “Returns”number | null
Null while the region decides the weather, and before the server’s world streams in.
getWeatherInfo()
Section titled “getWeatherInfo()”getWeatherInfo(
weather?): {fog: {dayFar:number;dayMax:number;dayNear:number;dayPower:number;nightFar:number;nightMax:number;nightNear:number;nightPower:number; };kind:"none"|"pleasant"|"cloudy"|"rain"|"snow";precipitation:number|null;visualEffect:number|null;weather:number;windSpeed:number; } |null
What a weather is, from this game’s data: its kind, its wind from 0 to 1, where its fog starts and ends by day and by night in game units, and the precipitation and screen effect it comes with.
Parameters
Section titled “Parameters”weather?
Section titled “weather?”string | number
A weather (WTHR) by form ID; the one the sky is in or moving to when left out.
Returns
Section titled “Returns”{ fog: { dayFar: number; dayMax: number; dayNear: number; dayPower: number; nightFar: number; nightMax: number; nightNear: number; nightPower: number; }; kind: "none" | "pleasant" | "cloudy" | "rain" | "snow"; precipitation: number | null; visualEffect: number | null; weather: number; windSpeed: number; } | null
Null when the form is not a weather, or the sky has none yet.
getWind()
Section titled “getWind()”getWind(): {
angle:number;angleRange:number;direction:number;speed:number; } |null
The wind the sky is blowing right now: its speed from 0 to 1, the weather’s direction in degrees and how many degrees it may swing either side, and the direction the sky drew within that swing, in degrees: the same on every player’s sky in a session.
Returns
Section titled “Returns”{ angle: number; angleRange: number; direction: number; speed: number; } | null
Null before the sky exists.
raycast()
Section titled “raycast()”raycast(
from,to,options?): {entity:number|null;fraction:number;hit:boolean;normal:Vector3;position:Vector3;ref:number|null; } |null
Casts a ray through the physics world the player stands in and tells what it struck first, testing what a bullet’s impact would: the ground, buildings, props, clutter and the bodies of actors, passing over the player’s own unless the options say otherwise.
Parameters
Section titled “Parameters”Where the ray starts, in game units.
Where it ends.
options?
Section titled “options?”ignore: an actor (form ID in this game, as References.getEntityBody gives one) whose own body the ray passes over; the local player when left out, nobody for null.
ignore?
Section titled “ignore?”number | string | null
Returns
Section titled “Returns”{ entity: number | null; fraction: number; hit: boolean; normal: Vector3; position: Vector3; ref: number | null; } | null
Whether it struck something before to; where; the surface’s unit normal there; how far along the ray, 0 to 1; the reference hit (null for the landscape); and, when that is another player’s body or an NPC, its network ID as the server knows it (player.id, npc.id). Without a hit the position is to, the fraction 1 and the normal zero. Null before the player is in a cell.