AxisAlignedBB boundingbox = new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ);
List<Entity> entityList = worldIn.getEntitiesWithinAABB(playerIn.getClass(), boundingbox);
for(int i = 0; i < entityList.size(); i++) {
entity.get(i).sendMessage(new TextComponentString(player.getDisplayNameString() + " displays their MyNewItem"));
}
Parameters for the BoudingBox are "minX, minY, minZ, maxX, maxY, maxZ". So if you want to get all players in a cube of 20x20x20 around you, you would need to do.
double minX = playerIn.posX - 10.0;
double minY = playerIn.posY - 10.0;
double minZ = playerIn.posZ - 10.0;
double maxX = playerIn.posX + 10.0;
double maxY = playerIn.posY + 10.0;
double maxZ = playerIn.posZ + 10.0;
The one below is probably more logical.