ClassNotFound err !

Discussion in 'Plugin Development' started by BlaSfaiMe, May 9, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    BlaSfaiMe

    Hi !
    I create a npc method, and there is an error
    Code:
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_8_R1.World
    But I do not know how is it possible !
    Can you help me ? (You'll maybe need my code !
    Code:
            Location npcloc1 = new Location(
                    Bukkit.getWorld("hub"),
                    -1.5,
                    6, -8.5,
                    0, 0
            );
            MinecraftServer nmserv = ((CraftServer) Bukkit.getServer()).getServer();
            WorldServer nmsworld = ((CraftWorld) npcloc1.getWorld()).getHandle();
            this.npc = new EntityPlayer(nmserv, nmsworld, new GameProfile(UUID.randomUUID(), this.name), new PlayerInteractManager(nmsworld));
            this.npc.teleportTo(npcloc1, false);
            PlayerConnection pc = ((CraftPlayer) e.getPlayer()).getHandle().playerConnection;
            pc.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, this.npc));
            pc.sendPacket(new PacketPlayOutNamedEntitySpawn(this.npc));
     
  2. Offline

    timtower Administrator Administrator Moderator

    @BlaSfaiMe Are you compiling with the same version as you are running?
     
  3. Offline

    BlaSfaiMe

    If a 1.8 plugin doesn't causes error with a 1.8.3 server, yes
     
  4. Offline

    timtower Administrator Administrator Moderator

    Need to be the exact same one.
    Preferably the same jar.
     
Thread Status:
Not open for further replies.

Share This Page