WhatSetting speed_multiplier_when_out_of_energy=0 on a logistic or construction robot doesn't fire any event when the robot dies, nor does the robots death animation fire. Instead, they just immediately disappear from the map. This is in contrast to combat robots, where they fire the on_combat_robot_expired event and play their normal death animation.
How to reproduceDownload the attached files, activate the mod and load the save game. Grab each of the robots off the quickbar and place them in world. The combat robot will float around and die, firing the on_combat_robot_expired event and it's death animation normally. The construction and logistic robot will float in place until their energy runs out, then immediately disappear, without any event firing or death animation playing.
The mod does 3 things. First, it sets speed_multiplier_when_out_of_energy=0 on both robots. Second, it increases their energy_per_tick to reduce the time it takes them to die. Third, in the control stage it registers events to print out a message when any of the following events occur: on_combat_robot_expired, on_entity_died, on_entity_damaged, on_entity_destroyed, and script_raised_destroy. Those are all the events that seem to possibly be related, but none of them are called when construction/logistic robots die, but combat robots properly trigger on_combat_robot_expired.
What's ExpectedFor dying robots to trigger an event when they die. Preferably the on_combat_robot_expired event, like other robots do when they run out of energy, the normal on_entity_died event, or maybe a new event for on_robot_expired if it's not desirable to include them with combat robots.
It's also expected their death animation triggers when they die, same as combat robots.
I don't think changing on_combat_robot_expired to fire for these would really affect many mods (both because I doubt this event gets used much and it only matters if someone changes logi/con robots - don't know of any mods so far that do), and the few it does affect could easily check for type=="combat-robot" (or filtering added to the event for that) to retain the exact same behavior it has now.
Including it with on_entity_died would be the least preferable, as that means extra LUA code to try and figure out what made the robot die - health or energy or something else, but at least it'd be possible, unlike now.