I want to use some stuff in 'net.minecraft.server.v1_12_R1' but I want my plugin to work in 1.15.2 and other versions. I am building my plugin for 1.12.2 and want it to work in other versions.
Youll need to create a class that handles all the different version (since class path and methods are changed almost every version)
You'll either have to use reflection or separate gradle/maven modules to import multiple jars. If you want to go the multiple modules route, you can look at the HolographicDisplays repository for a little guidance: https://github.com/filoghost/HolographicDisplays/tree/master/NMS
Good youtube tutorial: Some threads about it: https://www.spigotmc.org/wiki/nms-on-different-versions-without-reflection/ https://bukkit.org/threads/support-multiple-minecraft-versions-with-abstraction-maven.115810/ You could also use reflection as it's way easier to maintain, but it's also a good amount slower than abstraction