You could identify the six surrounding cubes easily. One way is to start from the center of the clicked cube, and calculate the points that are one cube-width away in each of the six directions (+x, -x, +y, -y, +z, -z). That's assuming that the cubes are aligned with the xyz-axes. Then destroy the six cubes that contain the calculated points.