This will return nil.
Code: Select all
entity = surface.create_entity{name="character-corpse", position={0,0}}
game.print(type(surface.find_entity(entity.name, entity.position)))
Code: Select all
entity = surface.create_entity{name="transport-belt", position={0,0}}
game.print(type(surface.find_entity(entity.name, entity.position)))
Code: Select all
local entity = surface.create_entity{name="character-corpse", position={0,0}}
local o = entity.position
game.print(type(surface.find_entities_filtered{area={{o.x-1,o.y-1},{o.x+1,o.y+1}},name='character-corpse'}[1])