Like half of the buildings are non-resistant since they are old and made of wood. IIRC only buildings built after 1991 are guaranteed to be earthquake resistant.
Earthquakes didn't start in 1991. The Japanese have always had to live with earthquakes and build accordingly.
One of the reasons Japan uses wood for construction is that combined with their traditional building techniques it results in earthquake resistant buildings.
Yes, but the situation got a lot better and a lot worse...
Sadly there has been a bunch of pretty devastating earthquakes in recent years. In particular in Kumamoto the one in 2016 (magnitude 6.5) was huge and many of the houses built at lower standard or not in great shape anymore got partially or totally wrecked. Right now the house that are left are relatively well built.
The bad news is, that still doesn't help as the cumulative damage can still bring them down, and they're still subject to landslides, water damage, and other second order disastrous events.