Creating a player NPC statue

Discussion in 'Plugin Development' started by 1SmallVille1, May 12, 2013.

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

    1SmallVille1

    Hey so I've been looking around for some examples as to how to do this. I did look at the Citezens code but couldn't find the class that took care of spawning the NPC. If someone could either tell me the class from that takes care of it or, preferably, tell me how to do it. Thanks in advanced.
     
  2. Offline

    chasechocolate

  3. Offline

    savagesun

    If you are using the Citizens API then you can spawn NPCs using the following:
    Code:
    NPC npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, "ID?");
    //then manipulate the npc as you wish to do so..
    npc.setName("derp");
    npc.addTrait(MyTrait.class);
     
    //then spawn in the npc
    npc.spawn(myLocation);
     
Thread Status:
Not open for further replies.

Share This Page