How do I get NMS classes for 1.18.1?

2.7k views Asked by At

Simple thing: I want to use NMS classes for my Spigot 1.18.1 Plugin. I downloaded Buildtools, there are all spigot classes inside (ItemStack, World, Player, ...) But I want to use NBTTagCompound or .asNMSCopy(); Methods but the classes are not inside (usally they were in previous versions). But now everything has to be changed and now I am wasting time figuring out how to get them back. I have literally no idea what I have to do next. Where can I get them back? Maven is not working on me, the dependencies are not getting found which I found at https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-2-release.534760/#post-4305163. Does someone have an idea, thanks.

1

There are 1 answers

0
justADeni On

Use BuildTools.jar to build the needed version. Then in your pom.xml under

<dependencies>
</dependencies>

add:

<dependency>
   <groupId>org.spigotmc</groupId>
   <artifactId>spigot</artifactId>
   <version>1.18.1-R0.1-SNAPSHOT</version>
   <scope>provided</scope>  
</dependency>

reload maven if needed and you should be good. There is no need to manually add .jars to your IDE, BuildTools automatically puts them in your local .m2 repository where you can grab them like this. Hope this helped