Solved Citizens problem

Discussion in 'Plugin Development' started by ContextCreator, Jul 5, 2015.

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

    ContextCreator

    I'm having this problem while using CitizensApi:

    Code:
                if(cmd.getName().equalsIgnoreCase("disguise")) {
                            NPCRegistry registry = CitizensAPI.getNPCRegistry();
                            NPC npc = registry.createNPC(EntityType.PLAYER, "NpcTest");
                            npc.spawn(p.getLocation());
                           }
    org.bukkit.command.CommandException: Unhandled exception executing command 'testspawn' in plugin PluginTest v5.2.13
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[cra
    ftbukkit.jar:git-Spigot-1642]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    1) ~[craftbukkit.jar:git-Spigot-1642]
    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServe
    r.java:767) ~[craftbukkit.jar:git-Spigot-1642]
    at net.minecraft.server.v1_7_R4.PlayerConnection.handleCommand(PlayerCon
    nection.java:1043) [craftbukkit.jar:git-Spigot-1642]
    at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java
    :880) [craftbukkit.jar:git-Spigot-1642]
    at net.minecraft.server.v1_7_R4.PacketPlayInChat.a(PacketPlayInChat.java
    :28) [craftbukkit.jar:git-Spigot-1642]
    at net.minecraft.server.v1_7_R4.PacketPlayInChat.handle(PacketPlayInChat
    .java:65) [craftbukkit.jar:git-Spigot-1642]
    at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:186
    ) [craftbukkit.jar:git-Spigot-1642]
    at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java
    :81) [craftbukkit.jar:git-Spigot-1642]
    at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:7
    34) [craftbukkit.jar:git-Spigot-1642]
    at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:2
    89) [craftbukkit.jar:git-Spigot-1642]
    at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:5
    84) [craftbukkit.jar:git-Spigot-1642]
    at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java
    :490) [craftbukkit.jar:git-Spigot-1642]
    at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:6
    28) [craftbukkit.jar:git-Spigot-1642]
    Caused by: java.lang.NoClassDefFoundError: net/citizensnpcs/api/CitizensAPI
    at me.contextcreator.tests.Main.onCommand(Main.java:164) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[cra
    ftbukkit.jar:git-Spigot-1642]
    ... 13 more
    Caused by: java.lang.ClassNotFoundException: net.citizensnpcs.api.CitizensAPI
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_31]
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_31]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_
    31]
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_31]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:101) ~[craftbukkit.jar:git-Spigot-1642]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:86) ~[craftbukkit.jar:git-Spigot-1642]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_31]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_31]
    at me.contextcreator.tests.Main.onCommand(Main.java:164) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[cra
    ftbukkit.jar:git-Spigot-1642]
    ... 13 more
    >
     
  2. Offline

    WesJD

     
  3. Offline

    Totom3

    @WesJD That is not relevant.

    @ContextCreator You did not add the Citizens implementation to your server's plugins.
     
    ContextCreator likes this.
  4. Offline

    WesJD

  5. Offline

    ContextCreator

    I actually do, I'mma try downloading diff. versions ^^.

    Thanks for answering @Totom3 & @WesJD.
     
  6. Offline

    Totom3

    @ContextCreator If you did yet the class cannot be found then perhaps Citizens failed to load? Check the logs. You can make sure Citizens is enabled in-game by testing it's commands.

    Also did you make your plugin depend on it (in plugin.yml)?
     
  7. Offline

    ContextCreator

    Yes i did, And now it actually works. For some reason everything was perfect, I just created a new server by moving my start.bat & Craftbukkit/Spigot.jar file into a new folder and worked. :) Thanks
     
Thread Status:
Not open for further replies.

Share This Page