Solved Setting up NMS in Eclipse

Discussion in 'Spigot Plugin Help' started by Acoder, Jun 16, 2021.

  1. Hi,
    I've decided to start using NMS but I don't know how to set it up.
    I can't import anything from net.minecraft.server. I only have the Spigot API. How do I get the NMS API?

    Thanks.
     
  2. In your dependency of spigot-api just remove the -api.

    Something like this:
    Code (Text):
    <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot</artifactId>
                <version>1.17-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
     
  3. Whats the dependency of the spigot api? and where do i find that file?
     
  4. Are u using maven?
     
  5. No.
     
  6. Well, you don't have to use spigot-api but use spigot. I strongly recommend u to use maven. It will make it easier.
     
  7. So there isnt a way to set NMS up without Maven or Gradle.
    But when you run BuildTools it creates a folder named CraftBukkit and under CraftBukkit\src\main\java\net\minecraft\server there are a lot of .java files lare these the NMS classes?
     
  8. Can I just recommend using IntelliJ, will allow you to use maven/gradle natively (assuming you install either) and is much easier than eclipse which is outdated.
     
    • Optimistic Optimistic x 1
  9. Yes, it is possible. How are u using your spigot-api?
     
  10. Add multiple of your spigots to your library
     
  11. What do you mean? I installed the spigot-api by running BuildTools.jar. Then i added spigot-api-1.16.5-R0.1-SNAPSHOT-shaded.jar
    to referenced libraries.
    Does NMS come with BuildTools?
    I dont know how to obtain the NMS api.
     
  12. Perhaps you should do some research be more informed about what you are getting into?
    Read this as a start.
    This may be possible, but I have never tried it.
    Eg. add to your 'Referenced Libraries' more than one Spigot version.
    spigot-1.16.5.jar
    spigot-1.17.jar
     
  13. I think you don't understand the problem. This page https://www.spigotmc.org/threads/nms-tutorials-1-introduction-to-nms.204127/ explains how NMS works, not how to set it up.
    Turns out spigot-api-1.16.5-R0.1-SNAPSHOT-shaded.jar does not contain NMS libraries, just the Spigot classes, and thats why I am unable to import net.minecraft.server.v1_16_R3.*;
    So adding spigot-1.16.5.jar instead is working for me.
     
    • Informative Informative x 1