LuaEntityDiedEventFilter: entity has/doesn't have loot
Posted: Mon Dec 13, 2021 3:21 pm
The event data of on_entity_died already contains the value "loot". Apparently, loot can be an empty table or an inventory (which may or may not be empty). I'd like to have a new filter "has_loot" that can be set to true (non-empty loot inventory) or false. I don't care what's in the loot inventory, that's easy enough to check in the event script. But for mods dealing explicitly with loot, I think it would be more efficient to trigger the event only if the killed entity actually has loot. Do you think such a filter could be added?