Is there any way to get nearby entities in Sponge? In Spigot, there’s just a simple .getNearbyEntities(…) that does it for you. I’m having a hard time finding it in Sponge. I see there’s an Extent#getEntities(). I’m not too sure what an Extent is, but isn’t it more or less like a Chunk, but with more info?
Hmmm, okay. So is there a way to create an “extent” area of size X x Y x Z and Extent#getEntities()? That could be a possible way to get nearby entities, but there’s probably an easier way xD
You can use extent.getExtentView to get a subsection view of the parent extent.
There are several useful methods to get entities. getEntities can take a predicate to filter through the list of entities. (you could filter for a nearby location for example)
Also you could use getIntersectingEntities, give the method an AABB (axis aligned bounding box) and it will return all entities within that box.