This event would fire whenever the daytime value of a surface rolls back to 0, indicating the beginning of a new day. This event would make it possible to do dynamic weather events that persist on a day-to-day basis. Currently, the only way to do this is to run on_tick events, which can create an unreasonable performance load when running every tick to check if a surface has begun a new day.
A typical type of dynamic weather this event would enable could include daily changes to the following LuaSurface fields:
dusk,dawn,evening,morning,ticks_per_day,solar_power_multiplier,min_brightness.
Changes to local_effect to particular LuaEntities on the surface, both during on_surface_day_begins and on placing the entity, could also be dynamically changed based on the current weather. Chemical plants could run more slowly or consume more energy when the daily temperature drops, for instance.
This event would also benefit from a SurfaceID event filter, allowing on_surface_day_begins events on a mod to only fire for a particular surface, typically their mod's planet.
The mod "Tougher Lightning Storms" would benefit from this mod. Currently, the mod runs an on_nth_tick event every 300 ticks and checks if a new day has begun on Fulgora before adjusting Fulgora's day length by a random amount. It's an imprecise process that would benefit from an event that tells the mod when a new day has begun.
Event type: on_surface_day_begins
-
MeteorSwarm
- Long Handed Inserter

- Posts: 58
- Joined: Thu Sep 25, 2025 10:49 pm
- Contact:
Re: Event type: on_surface_day_begins
Ah...would this help make it easier to implement acid rain to accelerate rust and decay? Please do!?
Re: Event type: on_surface_day_begins
In general i am not sold by this idea given that DayTime's 0 is rougly in the middle of a day, but given that it is relatively easy event to add and my curiosity what modders will come up with, for 2.1.15 i added `on_next_day_started` event with surface (LuaSurface) parameter. No filtering available because this is not a high frequency event.
-
MeteorSwarm
- Long Handed Inserter

- Posts: 58
- Joined: Thu Sep 25, 2025 10:49 pm
- Contact:
Re: Event type: on_surface_day_begins
Thank you! I was in the middle of implementing a version of this event in PlanetsLib, and I decided that firing the event when daytime == 0.5 would be more useful for most things, but since it's already possible to create delayed functions by creating rendering objects with a limited lifespan that trigger a function upon their death, you've functionally added the ability to fire events on any daytime by adding this event. Thank you.

