Solved Need help with NMS in 1.17.1

Discussion in 'Spigot Plugin Development' started by Peepersoak, Jul 18, 2021.

  1. Hey,

    I have started playing around with nms, basically just creating my own npc with their own path finder goal.

    I have been seen a lot of tutorial on nms, and the weird part is that nms stands for net.minecraft.server but intellij is importing

    Because of this, I can't build my project. It's throwing the "cannot access"

    I think is not the correct import?

    As per the other thread, they suggest that installing the latest buildtools will fix the problem but unfortunately it did not fix it.

    Code (Text):
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns=""



        <description>The main core plugin of AdventureCraft SMP Server</description>




    Code (Text):
    package me.peepersoak.adventurecraftcore.protocol;

    import net.minecraft.server.level.EntityPlayer;

    import org.bukkit.Location;
    import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;

    public class Sukuna extends EntityVillager {

        public Sukuna(Location loc) {
            super(EntityTypes.aV, ((CraftWorld) loc.getWorld()).getHandle());
            this.setPosition(loc.getX(), loc.getY(), loc.getZ());
            this.bP.a(new PathfinderGoalRandomStroll(this, 0.8D));
            this.bP.a(new PathfinderGoalNearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, false));

    Basically, I'm trying to spawn a villager that will attack the nearest player.

    Screen Shot of the error

    I just started using maven for about a month therefore I just have few knowledge about it.

    Thank you in advance


    The problem was that IntelliJ is actually trying to build my project using 1.8, changing this via POM won't actually fix it because I still need to change it in the actual settings. I finally manage to build it.
    #1 Peepersoak, Jul 18, 2021
    Last edited: Jul 18, 2021
  2. Package name of 1.17+ have changed for a better comprehension. Before it was something like "net.minecraft.server.v1_16_R1.EntityTypes" but in 1.17 it's "". You can compile buildtools and check the differences to see by your eyes, bu you're not wrong with those package ! (Well "NMS" is not NMS anymore, since it's not "net.minecraft.server" only ahah)

    All details about the mojang mapping and the spigot policy about 1.17 :