[Lib] [1.7.10] NPCFactory v1.4 - Create walking npcs with custom names and skins!

Discussion in 'Resources' started by lenis0012, May 26, 2014.

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

    KingFaris11

  2. Offline

    lenis0012

    It will be a bit more advanced than that.

    Working on animal behavior.
    Its kind of funny

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
    KingFaris11 likes this.
  3. Offline

    TigerHix

    Amazing. Definitely will use it in my plugins. :)
     
    lenis0012 likes this.
  4. Offline

    HelGod

    lenis0012
    Will this work for 1.7.2 or only 1.7.9?
     
  5. Offline

    bigteddy98

    only 1.7.9
     
  6. Offline

    lenis0012

    If you remove NPCProfile and change the NPCEntity constructor to use a clean name it works with 1.7.2
     
  7. Offline

    bigteddy98

    it's a new feature in 1.7.9, you know that yourself too. Please don't act like you are the one who made the whole system, Mojang did ;)
     
  8. Offline

    lenis0012

    You may not understand that it was a joke.
    But I was first to use game profiles properly.
     
  9. Offline

    lenis0012

  10. Offline

    RealDope

    How can I prevent the NPC's from being pushed around by players?
     
  11. Offline

    lenis0012

    Good one, forgot to implement that after adding velocity fixes
     
  12. lenis0012 great job :) can we include this in our plugin? should we give credit ?

    RealDope I think you can override the collide method (?)
     
  13. Offline

    lenis0012

    I would overide g(double, double, double)
    Credit would be nice, check our license: https://github.com/lenis0012/NPCFactory/blob/master/LICENSE

    Released v1.3
    • Fixed NPCInteractEvent
    • Added gravity
    • Added equipment methods
    • Changed NPC to an interface
    • Changed target to Entity intead of LivingEntity (thx DoctorDark)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
    Someone_Like_You likes this.
  14. Offline

    RealDope

    lenis0012 Can we make the NPC look like a villager rather than a human player?

    Also I'm not particularly familiar with this stuff, could you provide an example as to how to override g other than:

    Code:JAVA
    1.  
    2. @Override
    3. public void g(double x, double y, double z) {
    4.  
    5. }
    6.  
     
  15. Offline

    zombiekiller753

    lenis0012
    This may or may not be me, but I found an issue when trying to spawn an NPC with the same username and skin name as a player who has already joined (but not online) the server. It'll use the player's UUID from the player file, not the actual UUID, and then throw an exception when it tries to connect to Mojang's sessionserver.

    Is there something I'm doing wrong?
     
  16. Offline

    lenis0012

    RealDope That is how you do it actualy.

    zombiekiller753 My latest versions are having some tiny problems.
    I will look at it tomorrow for you
     
  17. Offline

    RealDope

    lenis0012
    And in regards to making the NPC look like a villager?
     
  18. Offline

    zombiekiller753

  19. Offline

    RealDope

    Villagers and players have different models; they look different in more ways than just skin.
     
  20. Offline

    zombiekiller753

    RealDope
    Why not just spawn in a villager then?
     
  21. Offline

    TeamJesus

    any plugins using this? be interesting to see :)
     
  22. Offline

    lenis0012

    I would just make a villager npc then.
    Make NPCEntity extend EntityVillager.

    Or manipulate the spawn packet.

    TeamJesus I will make one soon

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

    vemacs

    You might want to update the readme, the code looks like it's pulling data directly from Mojang, not SwordPVP (since, well, it's dead).
     
  24. Offline

    lenis0012

    Will do
     
  25. Offline

    Phasesaber

    Does v1.3 fix the "not being effected by momentum" thing?
     
  26. Offline

    CXdur

    Awesome work here, trying to use this and works great so far :)

    Just one question though, are there any efficient ways to block the NPC from getting pushed around or do I need to do this myself?
     
  27. Offline

    ThatUltraSeal

    I think ive read through this thoroughly, is it possible to make the NPC attack based on it's weapon?
     
  28. Offline

    DoctorDark

    ThatUltraSeal You could try something like:
    Code:java
    1. NPC npc = getNpcInstance;
    2. if (npc.getEquipment(EquipmentSlot.HAND).equals(new ItemStack(Material.DIAMOND_SWORD)))
    3. npc.playAnimation(NPCAnimation.SWING_ARM);
    4. }
     
  29. Offline

    Goblom

    lenis0012 I am currently having issues using they NPC events, it seems that not being called, i have not modified the code.

    Edit: Apparently being Invulnerable makes the Interact event not run
     
  30. Offline

    SoThatsIt

    DoctorDark npc.getEquipment(EquipmentSlot.HAND).getType() == Material.DIAMOND_SWORD
     
    DoctorDark likes this.
Thread Status:
Not open for further replies.

Share This Page