Okay, so _4iY is correct. In terms of FINDING existing entities, there’s not REALLY a good way to do so, however, entities have rooms and rooms have room ID’s. If your goal is to generate the entities yourself, then use your interior management system, you can leverage interior id’s / room id’s in order to dynamically render the entities based on player.
Not sure how efficient it can get but it’s worth a try.
Here’s a tool that uses and makes visually clear the concept of interiors and room ID’s called MLO Dev tool
And here’s an example of how you can get and use the interior ID’s and interior ROOM id’s can be found here
Hope these somewhat prove helpful, or at least give you an idea!