Citizens API NPC Spawning

Discussion in 'Plugin Development' started by Greyson, Dec 10, 2011.

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

    Greyson

    Does anyone know the code to spawn an NPC with the Citizens API??? Thanks for the help ^_^
     
  2. Offline

    Typhoon5

    Wouldn't you just spawn it just like any other mob, but select NPC as the mob type?
     
  3. Offline

    Greyson

    No you can't do that :/ Only Villagers
     
  4. You can't spawn NPCs via the API, but via Citizens itself.

    Code:java
    1. import net.citizensnpcs.resources.npclib.NPCManager;
    2. import net.citizensnpcs.api.event.NPCCreateEvent.NPCCreateReason;
    3.  
    4. public void spawnNPC() {
    5. NPCManager.register(<name of the NPC>, <the NPC location>, <name of the player who owns the NPC>, NPCCreateReason reason) ; // for the last one, check the API which reasons are available.
    6. }
     
Thread Status:
Not open for further replies.

Share This Page