Yeah, Luanti has an official modding API, which is documented and which doesn't break with every release: https://api.luanti.org/
For Minecraft Java Edition, they promised that a long time ago, but never delivered, so folks still just dick around with the decompiled code.