Development Assistance Custom NPCs

Discussion in 'Plugin Help/Development/Requests' started by benzimmer123, Apr 23, 2015.

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

    benzimmer123

    I just downloaded and added Citizens version 1.7.4 (My server version) to my build path and to my server plugins. Any ideas what is wrong with this? Am I using an outdated version or something? My build path is using my plugin so it can't be a different version and I have depended it in my plugin#yml. I got this error...

    Code:
    org.bukkit.command.CommandException: Unhandled exception executing command 'p' i
    n plugin PotionPVP v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spi
    got.jar:git-Spigot-1571]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    1) ~[spigot.jar:git-Spigot-1571]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServe
    r.java:767) ~[spigot.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.PlayerConnection.handleCommand(PlayerCon
    nection.java:1010) [spigot.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java
    :847) [spigot.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.PacketPlayInChat.a(PacketPlayInChat.java
    :28) [spigot.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.PacketPlayInChat.handle(PacketPlayInChat
    .java:65) [spigot.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:184
    ) [spigot.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java
    :81) [spigot.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:7
    31) [spigot.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:2
    89) [spigot.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:5
    84) [spigot.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java
    :490) [spigot.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:6
    28) [spigot.jar:git-Spigot-1571]
    Caused by: java.lang.NoClassDefFoundError: net/citizensnpcs/api/CitizensAPI
            at minecraft.pot.serverbot.BotManager.SpawnNPC(BotManager.java:16) ~[?:?
    ]
            at minecraft.pot.commands.Ping.onCommand(Ping.java:26) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spi
    got.jar:git-Spigot-1571]
            ... 13 more
    Caused by: java.lang.ClassNotFoundException: net.citizensnpcs.api.CitizensAPI
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_25]
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_25]
            at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_
    25]
            at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_25]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:98) ~[spigot.jar:git-Spigot-1571]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:83) ~[spigot.jar:git-Spigot-1571]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
            at minecraft.pot.serverbot.BotManager.SpawnNPC(BotManager.java:16) ~[?:?
    ]
            at minecraft.pot.commands.Ping.onCommand(Ping.java:26) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spi
    got.jar:git-Spigot-1571]
            ... 13 more
    This is my current code...

    Code:
        public void SpawnNPC(String name, Location l, Entity e) {
            NPCRegistry registry = CitizensAPI.getNPCRegistry(); // Line 16
            NPC npc = registry.createNPC(EntityType.PLAYER, name);
            npc.spawn(l);
            npc.getNavigator().setTarget(e, true);
        }

    EDIT: In case you're wondering, this post recently got moved to another thread but I don't really understand why as I'm using an API to develop my own plugin. This is the reason why it was under Plugin Development in the first place. So I re-posted and marked the other one as solved.
     
  2. Offline

    mine-care

    Is the API installed in the server? Is it the same version as the one you build against?
     
  3. Offline

    timtower Administrator Administrator Moderator

    Locked.
    We don't allow double posts.
    Your other ( and this ) thread got moved because you are using spigot, so an alternative
     
    mine-care likes this.
Thread Status:
Not open for further replies.

Share This Page