An NPC, or non-player character, is an entity in AdventureCraft. It's a player model standing still, with a selectable skin. It can be configured to say a message when clicked on, and can have a name. NPCs are removed when using the removemobs command. When moved away from their location, NPCs will begin walking back to it, and if they are moved too far away, will teleport back.
The future version has come, and now you can make NPCs follow a path, and have scripts for being attacked, upon being created, when attacked, when killed, etc.
The npc folder is a subfolder of a map, that you must create, which holds all the npc skins which the map has access to. To use a skin, copy the .png file into your npc folder. The directory format is:
AdventureCraft Folder/maps/Your Map/npc
Several NPC scripts can be set using the NPC stick:
- OnCreated: runs when the NPC is first created.
- OnUpdate: runs every tick.
- OnPathReached: runs when the NPC reaches the destination they are pathing towards.
- OnAttacked: runs when the NPC is attacked.
- OnDeath: runs on the NPC's death.
- OnInteraction: runs when the player interacts with the NPC (clicks on them).
These scripts can be selected from those saved in the 'scripts' folder.
- NPCs will sometimes duplicate. These duplicates do not function, they can't be moved, won't talk, and can't edited with the NPC stick; they only stand there and have a name. They can be removed using the removemobs command. The cause of this bug is unknown.
- NPCs can be moved away from their location by tricking them to get into a minecart. No matter how far you go, they won't teleport back until the minecart breaks. To trick an NPC into getting into a cart, you must move them far enough away so that they start walking, and have the minecraft between them and their destination.
- If an NPC is in water or lava when it teleports back to its origin it will continue jumping.