Color theme

World

Base: /api/world

Time, forced weather and weather per zone

Handler: WorldHandler
GET /api/world

Get world

Returns name, time of day and forced weather of the first loaded world.

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'

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"}'

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.