NpcSpawner lib - spawn basic NPCs

Discussion in 'Resources' started by Redecouverte, Feb 3, 2011.

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

    EchoMC

    Hi there everyone,
    I'm developing a plugin called Minequest and could use some help related to npcs. I had some old code that the previous developer used but it seems that it's not working correctly anymore. It seems that when you create an npc they will not respawn when the server is restarted. There is also a problem that when you type in the spawn command, you have to type it again to make it work. I've heard other people have run into similar problems but I've had trouble finding the fix for it. Here is the link to my code for use with
    svn: http://minequest.googlecode.com/svn/trunk/ I'm guessing the problem lies inside my old npclib. If someone could take a look at it, I would be extremely grateful. Thank you.
     
  2. Offline

    Top_Cat

    1. Update to this version of the NPCLib: https://github.com/Top-Cat/NPCLib
    2. Stop using svn, seriously.
     
  3. Offline

    thehutch

    Hey Top_Cat could you use this:

    <HumanNPC>.getSpoutPlayer().setSkin(string url) ???
     
  4. Offline

    Duckdoom5

    Great work I love it!
     
  5. Offline

    Luloak2

    Hy,

    could anybody give me an example how to spawn a HumanNPC using NPCLib? I am using the newest Version of NPCLib, but I do not know how to do that. Please help me!!!!!

    LG Luloak2

    PS: I do not want to use Spout!
     
  6. Offline

    Duckdoom5

    I have one question, I made some edits in the npc lib, on my own server it works but on another server it gives an error for every method I edited:

    NoSuchMethodeError: com.topcat.NPCManager.(edited method)

    now could you tell me why that is ? it seems like I can't change it, does it search in github or something like that? :p

    public NPCManager m = new NPCManager(plugin);

    public void create(){
    m.spawnHumanNPC("name of npc", location);
    }

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 8, 2016
  7. Offline

    Luloak2

    Duckdoom5 Yeeeaaahhhhh, you made my day :) Thank you soo much :)
     
  8. Is there a Maven repo so that I can include it?
     
  9. Offline

    okami35

    Hello, i have a little problem,
    How do you do to import your lib?
    Because i have downloaded the sources on github but when i import it in eclipse, i have many errors, do you have any ideas?

    Thank you for your help
     
  10. Offline

    Luloak2

    okami35 and all others who do not understand how to import

    1. Get the "com" folder out of the others, only the "com" folder is needed.
    2. Open Eclipse and drag the "com" folder into your "scr" folder.
    3. If you do not want to use Spout, comment the Spout import and the Spout-part in the HumanNPC.java
    4. It should work now :)
     
  11. Offline

    okami35

    Thank you for your help, i have tried but it does not work, i have some errors

    maybe i must add a special external jar? (actually i juste have craftbukkit.jar)
     
  12. Offline

    Luloak2

    No you must not add an external jar, hm, I do not understand why you have some errors... I cannot help you, sorry :(
     
  13. Offline

    okami35

    For example i have an error on the type "Entity"...

    Thank you
     
  14. You must have Bukkit and CraftBukkit
     
  15. Is there also a possibility to require it with Maven? So it updates automatically and I can include it with Maven Shade?
     
  16. Offline

    Luloak2

    I have a problem with my code, please help! I am using the original code from Redecouverte for the EntityTargetEvent with CLOSEST_PLAYER, I added only a system.out.println(), but if I go close to my NPC, the message is coming once and if I come close again there is no message! It only comes once, never twice :( How could I fix that?
     
  17. Offline

    cheddar262

    Currently it seems there is an error with your reference to j.am() in the NPCManager, your createExplosion events in BWorld, and a(Packet packet) and a(Packet101CloseWindow packet101closewindow) in NPCNetHandler. Just thought I would point it out even though you probably know about it.
     
  18. Offline

    Luloak2

    Yes, you are right, could anybody fix that please? Maybe Top_Cat ?
     
  19. Offline

    Lolmewn

    He never does until an RB comes out for some reason..
     
  20. Offline

    heisan213

    Wait... How do I download this? It isn't @ Github D:
     
  21. Offline

    Top_Cat

    Nah I'll update before RB just not pre-releases (which this isn't), I just have other things I've been busy with, should get this done soon.

    You download the source, it's a lib not a plugin
     
  22. Offline

    heisan213

    Haha, Im not an idiot :p I can't find it!
     
  23. Offline

    cheddar262

  24. Offline

    Knuckles5577

    How do I... download this? ( it has no download link) also, I'm new to plugins... so..
     
  25. Offline

    Top_Cat

    Click the link in the POST ABOVE YOURS then click downloads

    Also this is NOT a plugin
     
  26. Offline

    BloodShura

    How to verify if a Entity (from e.getEntity() in a Listener) is a HumanNPC?

    Thanks.
     
  27. Offline

    Top_Cat

    manager.isNPC(aBukkitEntity)
     
  28. Offline

    BloodShura

    Oh sorry, I writed wrong my question.

    I need to cast a entity or NPC, to HumanNPC.

    My code:
    Code:
        Player player = e.getPlayer();
        Entity ent = e.getRightClicked();
        NPCManager manager = new NPCManager(ShuraCore.plugin);
     
        if (manager.isNPC(ent)) {
          if (ShuraCore.plugin.lpCheck(player, "ShuraNPC.manager")) {
            if (player.isSneaking()) {
              NPC npc = manager.getNPC(manager.getNPCIdFromEntity(ent));
     
              Vars.NPCs.remove(player);
              Vars.NPCs.put(player, npc);
            }
          }
        }
    I need to cast the 'npc' to a HumanNPC. Is there a way to do it?

    Thanks.
     
  29. Offline

    ZNickq

    ((HumanNPC) npc)
     
    BloodShura likes this.
  30. Offline

    BloodShura

Thread Status:
Not open for further replies.

Share This Page