Question: how much mechanical energy is lost?
Answer: At the instant of the impact, potential energy =0 and thus mechanical energy=kinetic energy. The mechanical energy loss is equal to the kinetic energy at the impact because after the impact the block has no kinetic neither potential energy.