I need Help with spawning a Npc

Discussion in 'Plugin Help/Development/Requests' started by Saith1998, Dec 13, 2014.

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

    Saith1998

    Hello guys. I need help with my plugin. Always when I want to spawn a NPC with RemoteEntity I get an Error here is the Error:
    Code:
    Could not load 'plugins\Kitpvp.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: de/kum
    pelblase2/remoteentities/RemoteEntities
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:133) ~[spigot.jar:git-Spigot-1649]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:341) ~[spigot.jar:git-Spigot-1649]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:263) [spigot.jar:git-Spigot-1649]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugins(CraftServer.ja
    va:369) [spigot.jar:git-Spigot-1649]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.reload(CraftServer.java:86
    4) [spigot.jar:git-Spigot-1649]
            at org.bukkit.Bukkit.reload(Bukkit.java:301) [spigot.jar:git-Spigot-1649
    ]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    23) [spigot.jar:git-Spigot-1649]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    1) [spigot.jar:git-Spigot-1649]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServe
    r.java:767) [spigot.jar:git-Spigot-1649]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(Craf
    tServer.java:753) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.DedicatedServer.aB(DedicatedServer.java:
    326) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:2
    90) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:5
    84) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java
    :490) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:6
    28) [spigot.jar:git-Spigot-1649]
    Caused by: java.lang.NoClassDefFoundError: de/kumpelblase2/remoteentities/Remote
    Entities
            at Main.Main.<init>(Main.java:16) ~[?:?]
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    ~[?:1.8.0_05]
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    ~[?:1.8.0_05]
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce) ~[?:1.8.0_05]
            at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_0
    5]
            at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_05]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:76) ~[spigot.jar:git-Spigot-1649]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:129) ~[spigot.jar:git-Spigot-1649]
            ... 14 more
    Caused by: java.lang.ClassNotFoundException: de.kumpelblase2.remoteentities.Remo
    teEntities
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_05]
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_05]
            at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_
    05]
            at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_05]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:101) ~[spigot.jar:git-Spigot-1649]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:86) ~[spigot.jar:git-Spigot-1649]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_05]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_05]
            at Main.Main.<init>(Main.java:16) ~[?:?]
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    ~[?:1.8.0_05]
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    ~[?:1.8.0_05]
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce) ~[?:1.8.0_05]
            at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_0
    5]
            at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_05]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:76) ~[spigot.jar:git-Spigot-1649]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:129) ~[spigot.jar:git-Spigot-1649]
            ... 14 more
    And here is my code:
    Code:
    package Main;
    
    import org.bukkit.Bukkit;
    import org.bukkit.Location;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    
    import de.kumpelblase2.remoteentities.CreateEntityContext;
    import de.kumpelblase2.remoteentities.EntityManager;
    import de.kumpelblase2.remoteentities.RemoteEntities;
    import de.kumpelblase2.remoteentities.api.RemoteEntityType;
    
    public class Main extends JavaPlugin implements Listener{
        EntityManager manager = RemoteEntities.createManager(this);
        public void onEnable(){
       
           
            Bukkit.getServer().getPluginManager().registerEvents(this, this);
        }
    public void spawnNPC(String name, Location loc){
        CreateEntityContext c = manager.prepareEntity(RemoteEntityType.Human).asPushable(true).asStationary(false).atLocation(loc).withName(name);
        c.create();
    }
    @EventHandler
    public void onPlayerjoin(PlayerJoinEvent e){
        spawnNPC(e.getPlayer().getName(), e.getPlayer().getLocation());
    }
    }
    
     
  2. Offline

    Skionz

    @Saith1998 Is remote entities in your build path and the plugins folder?
     
  3. Offline

    Saith1998

  4. Offline

    tcvs

    @Saith1998 Could you please paste your whole log(via pastebin). It seems it can't find the
    Code:
    class org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: de/kumpelblase2/remoteentities/RemoteEntities
    Which probably means you don't have that in your plugins folder when launching the server.
     
  5. Offline

    Saith1998

    Unbenannt.png

    @tcvs here I put in the plugins folder
     
  6. Offline

    tcvs

    @Saith1998 This might sound stupid but is RemoteEntities a plugin or just has a library. What I am trying to say is it enabling on server start?
     
  7. Offline

    Saith1998

    @tcvs but how can I enable it?
     
  8. Offline

    Skionz

    @Saith1998 You can't enable it. Bukkit enables it for you. Is it a library or an actual plugin?
     
  9. Offline

    Saith1998

  10. Offline

    Skionz

    @Saith1998 Did you drag the source into your project? How did you actually get it working?
     
  11. Offline

    Saith1998

    @Skionz yes I put it in my project here Unbenannt.png
     
  12. Offline

    tcvs

    @Saith1998 That would probably mean you need to put that code in your project. I am curious where you got this library from.
     
  13. Offline

    Skionz

    @Saith1998 Check if remote entities is actually be enabled.
     
  14. Offline

    Saith1998

    @tcvs I download it a few months ago
    and
    @Skionz how do I check this?
     
  15. Offline

    Skionz

    tcvs likes this.
  16. Offline

    Funergy

    @Saith1998 You know you are in the wrong section for this.
    Spigot is in the Bukkit alternatives section.
     
  17. Offline

    Saith1998

    @Funergy between Spigot and Bukkit are nearly no differnces

    @Skionz what do you mean with the Console?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 29, 2016
  18. Offline

    Skionz

    @Saith1998 There are plenty of differences, look at the source. I mean look at the console and check if it is being enabled.
     
  19. Offline

    Saith1998

    @Skionz no its not being enabled
     
  20. Offline

    Skionz

    @Saith1998 Then you are doing something wrong. Make sure you are putting the remote entities plugin in the correct location.
     
  21. If your running spigot 1649 build npc's wont work
     
Thread Status:
Not open for further replies.

Share This Page