Oh then..
First, you have to use this method: "World#getEntitiesWithinAABBExcludingEntity"
it has two parameters: Entity, and AxisAlignedBB.
for the Entity, just put your Entity, to exclude the entity from the search list.
for AxisAlignedBB, get it from entity#boundingBox and use AxisAlignedBB#expand(r, r, r),
when r is the half size of box you are trying to find entity from.
And, iterate the list to find the nearest entity. (use posX, posY, posZ)
About entity's data, you have to specify what kind of data you are looking for.