ProductionHealthEffect needs a short explanation
Posted: Tue Nov 25, 2025 3:41 pm
I found ProductionHealthEffect (https://lua-api.factorio.com/latest/typ ... ffect.html) today.
It seems to only be used in captive biter spawners, so I can kind of make out how this works... But could you add a docstring to know without ctrl-F the whole data.raw? It's also not clear how the input value correlates to this comment: not_producing = -1 / 60, -- 5 hp per second in space-age/prototypes/entities.lua line 1463. I would intuitively expect this to be HP/tick, being worth -1 HP/sec, which matches the wiki saying "Starving spawners will stop producing biter eggs and lose health at a rate of 1 per second" (https://wiki.factorio.com/Captive_biter_spawner). So either the comment is wrong, or the wiki is wrong and some explanation is needed.
Proposal:
ProductionHealthEffect.producing > "Amount of HP the crafting machine gains per tick while producing. Can be negative."
ProductionHealthEffect.not_producing > "Amount of HP the crafting machine gains per tick while idle. Can be negative."
CraftingMachinePrototype.production_health_effect > "When defined, the crafting machine will constantly gain/lose HP constantly depending on whether or not it is actively producing something."
Thanks.
It seems to only be used in captive biter spawners, so I can kind of make out how this works... But could you add a docstring to know without ctrl-F the whole data.raw? It's also not clear how the input value correlates to this comment: not_producing = -1 / 60, -- 5 hp per second in space-age/prototypes/entities.lua line 1463. I would intuitively expect this to be HP/tick, being worth -1 HP/sec, which matches the wiki saying "Starving spawners will stop producing biter eggs and lose health at a rate of 1 per second" (https://wiki.factorio.com/Captive_biter_spawner). So either the comment is wrong, or the wiki is wrong and some explanation is needed.
Proposal:
ProductionHealthEffect.producing > "Amount of HP the crafting machine gains per tick while producing. Can be negative."
ProductionHealthEffect.not_producing > "Amount of HP the crafting machine gains per tick while idle. Can be negative."
CraftingMachinePrototype.production_health_effect > "When defined, the crafting machine will constantly gain/lose HP constantly depending on whether or not it is actively producing something."
Thanks.