Eranio
Color theme

World

Base: /api/world

The world section shows and controls the time of day and the weather. You read what time it is in the game world, set the time to midnight, sunrise, noon or sunset, and force weather either for the whole world or for single zones 0 to 4. This fits event scripts, a weather display on your website or a panel with weather tiles. Time and weather apply to the first loaded world, and for weather you can pick another one with the world parameter.

Handler: WorldHandler
GET /api/world

Get world

Returns world_count, world_name and tick of the first loaded world, plus currentHour, dayProgress, sunlightFactor and moonPhase of the time of day as well as weather, forced_weather and zone_weather.

Response Example

{
  "world_count": 2,
  "world_name": "default",
  "tick": 123456,
  "currentHour": 14,
  "dayProgress": 0.6,
  "sunlightFactor": 0.9,
  "moonPhase": 2,
  "weather": "clear"
}

cURL

curl -X GET 'http://localhost:5550/api/world' \
  -H 'X-Admin-Token: YOUR_TOKEN'
The endpoint always describes the first loaded world. If no weather is forced, weather is clear and forced_weather is null. zone_weather only shows the zones you have set yourself. If the server cannot read the details within 2 seconds, those fields are missing and you only get the basic values.

Internal Behavior

Reads WorldTimeResource and the world config on the world thread.
POST /api/world/time

Set time

Sets the time of day.

Request Body

Field Type Required Description
time string Yes midnight, sunrise, noon or sunset

Response Example

{
  "success": true,
  "time": "noon"
}

cURL

curl -X POST 'http://localhost:5550/api/world/time' \
  -H 'X-Admin-Token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"time": "noon"}'
The value time is required and must be midnight, sunrise, noon or sunset (case does not matter). Errors come with status 200 and success: false, for example "Missing time", "Invalid time. Use: midnight, sunrise, noon, or sunset" or "No worlds available". The time is only set in the first loaded world, there is no parameter for other worlds.

Internal Behavior

Sets the day time to 0.0, 0.25, 0.5 or 0.75 of a day.
GET /api/world/weather

Weather per zone

Returns the current surface weather of zones 0 to 4, the weathers each zone can have, the weather fixed per zone and which players are where.

Parameters

Name Type Required Description
world string No World name, default is the first world

Response Example

{
  "success": true,
  "world": "default",
  "zones": [
    {
      "zone": "Zone2",
      "override": "Zone2_Sand_Storm",
      "current": "Zone2_Sand_Storm",
      "weathers": ["Zone2_Sunny", "Zone2_Sand_Storm", "Zone2_Thunder_Storm"],
      "players": ["Steve"]
    }
  ],
  "players": [
    {
      "name": "Steve",
      "environment": "Env_Zone2_Deserts",
      "zone": "Zone2",
      "weather": "Zone2_Sand_Storm"
    }
  ]
}

cURL

curl -X GET 'http://localhost:5550/api/world/weather?world=default' \
  -H 'X-Admin-Token: YOUR_TOKEN'
forced is only included while a weather is forced for the whole world. The weathers list comes from the forecasts of the zone and the weather assets of the zone, so it changes with the game version.

Internal Behavior

Reads WeatherResource on the world thread. Hytale picks a weather for every environment each in-game hour, the most common surface weather of a zone is reported as current.
POST /api/world/weather/zone

Set weather of a zone

Fixes the weather of one zone or gives it back to the game forecast with natural.

Request Body

Field Type Required Description
zone string Yes Zone0 to Zone4
weather string Yes A weather ID such as Zone2_Sand_Storm, or natural
world string No World name, default is the first world

Response Example

{
  "success": true,
  "world": "default",
  "zone": "Zone2",
  "weather": "Zone2_Sand_Storm"
}

cURL

curl -X POST 'http://localhost:5550/api/world/weather/zone' \
  -H 'X-Admin-Token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"zone": "Zone2", "weather": "Zone2_Sand_Storm"}'
Applies to the surface of the zone only, caves, mines, dungeons and underground areas keep their own weather. The choice is saved in zone-weather.json and survives restarts.

Internal Behavior

Writes the weather into WeatherResource for every surface environment of the zone and sets it again every second, so the hourly forecast does not replace it. Not in caves, mines, dungeons or underground, saved in zone-weather.json and survives restarts.
POST /api/world/weather

Force weather for the whole world

Forces one weather for the whole world, overriding every zone. natural lifts it again.

Request Body

Field Type Required Description
weather string Yes A weather ID such as Zone1_Rain, or natural. The old short names clear, rain, storm and snow still work.
world string No World name, default is the first world

Response Example

{
  "success": true,
  "weather": "Zone3_Snow_Storm"
}

cURL

curl -X POST 'http://localhost:5550/api/world/weather' \
  -H 'X-Admin-Token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"weather": "rain"}'

Internal Behavior

Checks the weather asset map and sets the forced weather of the world (saved in the world config). Zones with their own weather are paused while a weather is forced.