Among collective behaviors of biological swarms and flocks, the attractive/repulsive (A/R) functional links between particles play an important role. By slightly changing the cutoff distance of the A/R function, a drastic transition between two distinct aggregation patterns is observed. More precisely, a large cutoff distance yields a liquid-like aggregation pattern where the particle density decreases monotonously from the inside to the outwards within each aggregated cluster. Conversely, a small cutoff distance produces a crystal-like aggregation pattern where the distance between each pair of neighboring particles remains constant. Significantly, there is an obvious spinodal in the variance curve of the inter-particle distances along the increasing cutoff distances, implying a legible transition pattern between the liquid-like and crystal-like aggregations. This work bridges the aggregation phenomena of physical particles and swarming of organisms in nature upon revealing some common mechanism behind them by slightly varying their inter-individual attractive/repulsive functions, and may find its potential engineering applications, for example, in the formation design of multi-robot systems and unmanned aerial vehicles (UAVs).