We present a technique which allows the direct determination of defect structures and energetics in the molecular dynamics framework. Due to its computational simplicity, it can be applied during the actual molecular dynamics simulation. This allows the monitoring of the evolution of the defect properties as a function of time and/or temperature. We have applied it to deduce a criterion for discriminating the amorphous and crystalline phases of Si, and to study the variation with temperature of the configuration and formation energy of the Si self-interstitial.