0

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.

  • Have you tried to build the spigot with the BuildTools ? – Elikill58 Mar 01 '22 at 15:14
  • As I said, I used BuildTools.jar to get "spigot-api-1.18.1-R0.1-SNAPSHOT-shaded.jar" and added this to my buildpath. Or what do you mean should I do with BuildTools? Should I use an other .jar? There are thousands... – GamingForce4D Mar 01 '22 at 15:20
  • Oh yes, sorry. With maven & the local reposity it should works. Personnally, I build all spigot with buildtools and with local maven it find all versions – Elikill58 Mar 01 '22 at 15:38
  • Okay! Do you use NMS? Can you tell me how my pom.xml should look like? I converted my Plugin to a maven Project and never touched my pom.xml and to be honest I have no clue on how to use it properly. I know that some dependencies have to be added, but which? – GamingForce4D Mar 01 '22 at 19:12
  • You should use `org.bukkit.craftbukkit` dependancy, like `org.bukkit` as groupId, `craftbukkit` as artifactId and in the version, something like `1.18.1-R0.1-SNAPSHOT` – Elikill58 Mar 01 '22 at 19:19
  • Well not exactly. I used https://www.spigotmc.org/wiki/spigot-maven/ and this worked. BUT the problem persists. I have no NMS classes... Where do I get these? – GamingForce4D Mar 02 '22 at 14:37

1 Answers1

1

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

justADeni
  • 9
  • 3