It was rewritten in C++, because Playstation, XBox, iOS, Android[0] don't do Java and Microsoft wanted a single codebase.
[0] - Android Java isn't really the same Java as in Minecraft.
[0] - Android Java isn't really the same Java as in Minecraft.
There are two versions of Minecraft now.
The main reason Minecraft Java is still alive is the hackability and the resulting extensive mod ecosystem.