Light detection and ranging (LiDAR) can quickly and accurately obtain 3D point clouds on the surface of rock masses, and on the basis of this, discontinuity information can be extracted automatically. This paper proposes a new method to automatically extract discontinuity information from 3D point clouds on the surface of rock masses. This method first applies the improved K-means algorithm based on the clustering algorithm by fast search and find of density peaks (DPCA) and the silhouette coefficient in the cluster validity index to identify the discontinuity sets of rock masses, and then uses the hierarchical density-based spatial clustering of applications with noise (HDBSCAN) algorithm to segment the discontinuity sets and to extract each discontinuity from a discontinuity set. Finally, the random sampling consistency (RANSAC) method is used to fit the discontinuities and to calculate their parameters. The 3D point clouds of the typical rock slope in the Rockbench repository is used to extract the discontinuity orientations using the new method, and these are compared with the results obtained from the classical approach and the previous automatic methods. The results show that, compared to the results obtained by Riquelme et al. in 2014, the average deviation of the dip direction and dip angle is reduced by 26% and 8%, respectively; compared to the results obtained by Chen et al. in 2016, the average deviation of the dip direction and dip angle is reduced by 39% and 40%, respectively. The method is also applied to an artificial quarry slope, and the average deviation of the dip direction and dip angle is 5.3° and 4.8°, respectively, as compared to the manual method. Furthermore, the related parameters are analyzed. The study shows that the new method is reliable, has a higher precision when identifying rock mass discontinuities, and can be applied to practical engineering.