OnWeatherChange: Difference between revisions
Jump to navigation
Jump to search
Update Lua event reference |
Complete upcoming 0.1.9 documentation: weather, crafting UI, world removal, doors and ladders; preserve release status |
||
| Line 38: | Line 38: | ||
[[Category:Server Events]] | [[Category:Server Events]] | ||
[[Category:World Events]] | [[Category:World Events]] | ||
<!-- weather019:start --> | |||
== Extended weather from 0.1.9 == | |||
'''Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated clients and server.''' | |||
This existing API retains its call shape; the catalog is extended, not restricted to five names. See [[Weather]] and [[Weather catalog]]. Server target/revision and client acknowledgement are not proof of the final rendered image. The new presets still require in-game visual qualification; use compatible clients and test late join, indoor areas and returning to ordinary weather. | |||
<!-- weather019:end --> | |||
Revision as of 20:57, 19 October 2026
onWeatherChange
Triggered after the server accepts an authoritative weather transition.
Availability
This event is available in server-side scripts.
Callback signature
onWeatherChange(previousWeather, currentWeather, transitionMs, sourceResource)
Parameters
| Name | Type | Description |
|---|---|---|
previousWeather |
string |
The previous normalized weather key. |
currentWeather |
string |
The new normalized weather key. |
transitionMs |
int |
Transition duration in milliseconds. |
sourceResource |
string |
The resource that requested the change. |
Examples
Handle the event:
addEventHandler("onWeatherChange", root, function(previousWeather, currentWeather, transitionMs, sourceResource)
outputDebugString("Weather: " .. previousWeather .. " -> " .. currentWeather)
end)
Notes
- Late joiners receive the current authoritative weather from the server snapshot.
Extended weather from 0.1.9
Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated clients and server.
This existing API retains its call shape; the catalog is extended, not restricted to five names. See Weather and Weather catalog. Server target/revision and client acknowledgement are not proof of the final rendered image. The new presets still require in-game visual qualification; use compatible clients and test late join, indoor areas and returning to ordinary weather.