it wasn’t illegal until some major contributor didn’t know that Mojang bought the entire Bukkit team out and they subsequently decided to pull the rights to their code
idk, the only mod i have ever used is optifine and even then that's a recent thing from what i have seen though yeah modding looks horrible both to use and to develop
fun fact: when .NET 5 was originally announced they promised Java interop everywhere. And when it finally released they quietly conveniently forgot they ever said anything about it haha