We introduce a method for constructing end-to-end mock galaxy catalogues using a semianalytical model of galaxy formation, applied to the halo merger trees extracted from a cosmological N-body simulation. The mocks that we construct are lightcone catalogues, in which a galaxy is placed according to the epoch at which it first enters the past lightcone of the observer, and incorporate the evolution of galaxy properties with cosmic time. We determine the position between the snapshot outputs at which a galaxy enters the observer's lightcone by interpolation. As an application, we consider the effectiveness of the BzK colour selection technique, which was designed to isolate galaxies in the redshift interval 1.4 <z <2.5. The mock catalogue is in reasonable agreement with the observed number counts of all BzK galaxies, as well as with the observed counts of the subsample of BzKs that are star-forming galaxies. We predict that over 75 per cent of the model galaxies with KAB = 23, and 1.4 <z <2.5, are selected by the BzK technique. Interloper galaxies, outside the intended redshift range, are predicted to dominate bright samples of BzK galaxies (i.e. with KAB = 21). Fainter K-band cuts are necessary to reduce the predicted interloper fraction. We also show that shallow B-band photometry can lead to confusion in classifying BzK galaxies as being star forming or passively evolving. Overall, we conclude that the BzK colour selection technique is capable of providing a sample of galaxies that is representative of the 1.4 <z <2.5 galaxy population ©2012 The Authors.