Solved Okay what is with this NPE...

Discussion in 'Plugin Help/Development/Requests' started by UniqueNameDen, Mar 19, 2015.

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

    UniqueNameDen

    I don't get it, at all...
    in code:
    Code:java
    1.  
    2. Villager villager = p.getLocation().getWorld().spawn(p.getLocation(),Villager.class);
    3. core.APIrAI.removeAI(villager);
    4.  

    villager returns NPE error, but I still can:
    Code:java
    1.  
    2. villager.setProfession(Villager.Profession.LIBRARIAN);
    3. villager.setCustomName(args[0]);
    4. villager.setCustomNameVisible(false);
    5.  


    Extra notes:
    core.APIrAI is coded by me which gets an entity and gets its UUID and does stuff with it

    Using: craftbukkit 1.8/1.8.3
     
    Last edited: Mar 20, 2015
  2. Offline

    Konato_K

    @UniqueNameDen Whatever you do on removeAI it's causing the problem then.
     
  3. Offline

    teej107

  4. Offline

    UniqueNameDen

    its not just with removeAI, even when I try to add it into an entity list List<Entity> it still gives me NPE, if I do it for all entitys in a world, it works...

    I'm not that stupid, i know how to read logs, if I didn't knew i would give stack trace, yes I already checked, if I do it for all entitys in a world, it works...

    Solved: Hah, I knew it wasn't my fault argh the world of alternaives
     
    Last edited: Mar 20, 2015
Thread Status:
Not open for further replies.

Share This Page