The mod The Blueprint Lab - Bud caused a non-recoverable error.
Please report this error to the mod author.
Error while running event BlueprintLab_Bud17::on_gui_click (ID 1)
LuaEntity API call when LuaEntity was invalid.
stack traceback: BlueprintLab_Bud17/scripts/common.lua:15: in function 'DestroyEntity' BlueprintLab_Bud17/scripts/logic.lua:125: in function 'ClearLab' BlueprintLab_Bud17/scripts/gui.lua:34: in function <BlueprintLab_Bud17/scripts/gui.lua:28>
[C]: in function 'index'
__BlueprintLab_Bud17/scripts/common.lua:15: in function 'DestroyEntity' BlueprintLab_Bud17/scripts/logic.lua:125: in function 'ClearLab' BlueprintLab_Bud17/scripts/gui.lua:34: in function <BlueprintLab_Bud17/scripts/gui.lua:28>
it crashes for me too everyso often but can we also add a confirmation box when clearing i almost lost like 12 hours of work because i fat fingered the clear instead of leave button (on a server so no local autosaving)
I'd start with LTN, Train Supply Manager and Electric Trains. All three of those mods create extra entities when their particular item is placed in the world and remove it when it is mined/destroyed.
Looking at your clear lab code it gets all entities on the lab surface then goes down the list destroying them indiscriminately. Which is fine until a player places a multi-entity item. Player places say LTN train stop, LTN detects LTN train stop and spawns a special LTN combinator next to the train stop. Your mod when cleaning the lab destroys the LTN train stop, LTN destroys LTN combinator, your mod attempts to destroy LTN combinator, your mod blows up because entity isn't valid.
I bet adding a quick sanity check to the start of DestroyEntity function would solve the issue for just about every mod.
if not entity.valid then
--Entity already destroyed. Next!