Spigot [API] NPCLib 2.5.1-SNAPSHOT

API to spawn NPCs

  1. inventivetalent submitted a new resource:

    [API] NPCLib - Simple API to spawn player NPCs

    Read more about this resource...
     
    • Like Like x 3
  2. Does this freezes the NPC too? So it cant be pushed and it cant move?
     
  3. You can simply call setFrozen(true);
    to freeze it.
    (Or just don't set the collision etc. to true)
     
  4. Thanks i will use this lib!
     
  5. How can you set the NPC type?

    Also: java.lang.NoClassDefFoundError: de/inventivegames/npc/NPCLib
     
  6. I've already created a NPC Library.
    It would be really nice if the community's effort wasn't split between two projects.
    I will give you write access to the repository, just say the word.

    It supports 1.7.9, 1.7.10, protocol hack, 1.8, and 1.8.3. It has no dependencies, and can be shaded in to other plugins.
    It has skins, but some help with pathfinding would be nice :).
     
  7. How to install that lib?
     
  8. You shade it into your plugin using maven.
    Here is the info thread.
     
  9. @Techcable
    Sorry, I completely missed that since it isn't a "real" resource.
    I'll have a look at it :)
     
    • Like Like x 1
  10. @JordyPwner
    Did you add the API to your project?
    Did you add it as a dependency in your plugin.yml?
    (If you did all of it, please post the complete stack trace)
     
  11. Can u set the NPC type?
     
  12. No, it is only for Player NPCs at this point.
     
  13. That sucks i need to make a NPC as villager :p
     
  14. There will be other types of NPCs in upcoming versions, just use Techcable's API for now ;)
     
  15. I've been looking for something like this for days, thanks for making this lib! simple to use
     
  16. Is there any way to set the skin of an already existing npc?
     
  17. hmm, I keep getting this error when I spawn an entity
    Code (Text):
    [08:28:22] [Server thread/WARN]: java.lang.ClassNotFoundException: net.minecraft.server.v1_8_R2.EnumGamemode
    [08:28:22] [Server thread/WARN]:     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:91)
    [08:28:22] [Server thread/WARN]:     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86)
    [08:28:22] [Server thread/WARN]:     at java.lang.ClassLoader.loadClass(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at java.lang.ClassLoader.loadClass(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at java.lang.Class.forName0(Native Method)
    [08:28:22] [Server thread/WARN]:     at java.lang.Class.forName(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at de.inventivegames.npc.util.Reflection.getNMSClass(Reflection.java:54)
    [08:28:22] [Server thread/WARN]:     at de.inventivegames.npc.util.NMSClass.<clinit>(NMSClass.java:97)
    [08:28:22] [Server thread/WARN]:     at de.inventivegames.npc.profile.NPCProfileBase.loadProfile(NPCProfileBase.java:72)
    [08:28:22] [Server thread/WARN]:     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [08:28:22] [Server thread/WARN]:     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at java.lang.reflect.Method.invoke(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at de.inventivegames.npc.NPCLib.spawnNPC(NPCLib.java:64)
    [08:28:22] [Server thread/WARN]:     at de.inventivegames.npc.NPCLib.spawnNPC(NPCLib.java:54)
    [08:28:22] [Server thread/WARN]:     at me.Sindybad.npcfun.MyListener.onCommand(MyListener.java:31)
    [08:28:22] [Server thread/WARN]:     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
    [08:28:22] [Server thread/WARN]:     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
    [08:28:22] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_8_R2.CraftServer.dispatchCommand(CraftServer.java:646)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.PlayerConnection.handleCommand(PlayerConnection.java:1133)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.PlayerConnection.a(PlayerConnection.java:968)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(PacketPlayInChat.java:45)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(PacketPlayInChat.java:1)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.PlayerConnectionUtils$1.run(SourceFile:13)
    [08:28:22] [Server thread/WARN]:     at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at java.util.concurrent.FutureTask.run(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.SystemUtils.a(SourceFile:60)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:710)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:368)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:651)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:554)
    [08:28:22] [Server thread/WARN]:     at java.lang.Thread.run(Unknown Source)
    [08:28:22] [Server thread/WARN]: java.lang.reflect.InvocationTargetException
    [08:28:22] [Server thread/WARN]:     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    [08:28:22] [Server thread/WARN]:     at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at java.lang.reflect.Constructor.newInstance(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at de.inventivegames.npc.NPCLib.spawnNPC(NPCLib.java:65)
    [08:28:22] [Server thread/WARN]:     at de.inventivegames.npc.NPCLib.spawnNPC(NPCLib.java:54)
    [08:28:22] [Server thread/WARN]:     at me.Sindybad.npcfun.MyListener.onCommand(MyListener.java:31)
    [08:28:22] [Server thread/WARN]:     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
    [08:28:22] [Server thread/WARN]:     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
    [08:28:22] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_8_R2.CraftServer.dispatchCommand(CraftServer.java:646)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.PlayerConnection.handleCommand(PlayerConnection.java:1133)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.PlayerConnection.a(PlayerConnection.java:968)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(PacketPlayInChat.java:45)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(PacketPlayInChat.java:1)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.PlayerConnectionUtils$1.run(SourceFile:13)
    [08:28:22] [Server thread/WARN]:     at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at java.util.concurrent.FutureTask.run(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.SystemUtils.a(SourceFile:60)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:710)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:368)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:651)
    [08:28:22] [Server thread/WARN]:     at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:554)
    [08:28:22] [Server thread/WARN]:     at java.lang.Thread.run(Unknown Source)
    [08:28:22] [Server thread/WARN]: Caused by: java.lang.NoSuchMethodException: net.minecraft.server.v1_8_R2.PlayerInteractManager.b(null)
    [08:28:22] [Server thread/WARN]:     at java.lang.Class.getDeclaredMethod(Unknown Source)
    [08:28:22] [Server thread/WARN]:     at de.inventivegames.npc.entity.NPCEntityBase.initialize(NPCEntityBase.java:146)
    [08:28:22] [Server thread/WARN]:     at de.inventivegames.npc.entity.NPCEntity_v1_8_R2.<init>(NPCEntity_v1_8_R2.java:60)
    [08:28:22] [Server thread/WARN]:     ... 23 more
     
  18. How are you currently changing the skins?

    Seems to be a compatibility problem with 1.8.3. Will be fixed.
     
    • Optimistic Optimistic x 1