[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

    TigerHix

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

    HelGod

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

    bigteddy98

    only 1.7.9
     
  4. Offline

    lenis0012

    If you remove NPCProfile and change the NPCEntity constructor to use a clean name it works with 1.7.2
     
  5. 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 ;)
     
  6. Offline

    lenis0012

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

    lenis0012

  8. Offline

    RealDope

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

    lenis0012

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

    RealDope I think you can override the collide method (?)
     
  11. 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.
  12. 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.  
     
  13. Offline

    Deleted user

    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?
     
  14. 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
     
  15. Offline

    RealDope

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

    Deleted user

  17. Offline

    RealDope

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

    Deleted user

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

    TeamJesus

    any plugins using this? be interesting to see :)
     
  20. 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
  21. 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).
     
  22. Offline

    lenis0012

    Will do
     
  23. Offline

    Phasesaber

    Does v1.3 fix the "not being effected by momentum" thing?
     
  24. 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?
     
  25. Offline

    ThatUltraSeal

    I think ive read through this thoroughly, is it possible to make the NPC attack based on it's weapon?
     
  26. 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. }
     
  27. 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
     
  28. Offline

    SoThatsIt

    DoctorDark npc.getEquipment(EquipmentSlot.HAND).getType() == Material.DIAMOND_SWORD
     
    DoctorDark likes this.
  29. Offline

    shohouku

    Having problems compiling it in Eclipse as an API.

    I can't depend the API, the API is known as 'unknown'.
     
  30. Offline

    lenis0012

    Clone the code form github and add it manually.

    True.
    But the interact event is being buggy anyway
     
Thread Status:
Not open for further replies.

Share This Page