I tried the code below. It creates the entities, but nearbyLoot is empty.
Code: Select all
local loot = {name="iron-plate", count=10}
event.entity.surface.spill_item_stack(event.entity.position, loot)
local nearbyLoot = event.entity.surface.find_entities_filtered{
position=event.entity.position,
radius=10,
name=loot.name
}
if next(nearbyLoot) == nil then
log("no nearby loot")
return
end