Care and feeding of NPCs
Creating NPCs can be fun! You can add people or animals in specific locations or have them follow paths around the world. You can have them react to things or go to different locations at random, by time of day, or even weather. You may not do anything more than make an NPC with the look of a police officer that stands guard. That is great too.
This is a basic workflow for creating an all-purpose NPC.
- Create the NPC
- Add a trait or behavior
- Tell them what to talk about
- Equip them
- Set movement options
- Add mob dependent options
- Manage your NPCs
For example, create a wandering priest villager:
/npc create friend1
/npc type villager
/npc profession PRIEST
/npc lookclose
/waypoint provider wander
Depending on the NPC type, additional options may be available.
All other information is available from Citizens Wiki.
Create the NPC
Create a new NPC
/npc create friend1
You can create an NPC with the /npc create command. For example, create the NPC and then assign its mob type and trait. The mob type is any creature type like CHICKEN, PIG, PLAYER. The default type is PLAYER.
create
/npc create [name] ((-b,u) --at (x:y:z:world) --type (type) --trait ('trait1, trait2...') --b (behaviours))
Parameters
Parameter | Required | Description |
---|---|---|
name | yes | Name to give the NPC. |
b | no | Set baby size instead of an adult. |
u | no | No idea. |
at | no | Coordinates and world to place the NPC. |
type | no | Mob type to use. |
trait | no | Adds the trait type to the NPC. NPCs can have multiple traits. |
behavior | no | Adds and removes behaviours from an NPC. A behaviour is a script file that is executed and adds ‘goals’ to the NPC which can run every tick. These can do anything you can program/think of! |
Select NPC
Select the NPC named friend1. Then display information about the selected NPC.
/npc select friend1
/npc
When you create an NPC, it is selected automatically. Anytime after that you must select the NPC before you can make any changes to it.
select
/npc select|sel [id|name] (--r range)
Parameters
Parameter | Description |
---|---|
name | Name of NPC. |
id | ID number of NPC. |
r | Block range of NPC. |
information
/npc
Gives information about the currently selected NPC such as name, id, type, spawn location, traits.
Set a mob type
Set the NPC to a baby pig:
/npc create piglet
/npc type pig
/npc age baby
Set the NPC to a skeleton:
/npc create dembones
/npc type skeleton
Changes an NPC’s mob type. By default it is a player. Possible types are here supported mob types
type
/npc type [mob_type]
Parameters
Parameter | Description |
---|---|
type | Mob type name to change the NPC into. |
Mob types
Here is a short list of mobs you can create. There are probably more.
Passive | Hostile |
---|---|
bat | blaze |
chicken | cave spider |
cow | creeper |
dolphin | enderman |
horse | ender_dragon |
iron_golem | ghast |
minecart | magma_cube |
mushroom_cow | phantom |
ocelot | pig_zombie |
parrot | player |
pig | shulker |
polar_bear | silverfish |
pufferfish | skeleton |
rabbit | slime |
sheep | spider |
squid | witch |
snowman | wolf |
tropical fish | wither |
turtle | zombie |
villager | zombie_villager |
Select the NPC costume
Sets an NPC’s skin name. By default, the costume / skin is the name of the NPC. You can keep the name you want but change the costume to the skin of another player.
Change the skin of NPC named marvin
/npc select marvin
/npc skin -l bob_the_builder
By default an NPC will have the default Steve or Alex skin. If you want a custom skin you can do one of the following:
- Rename the NPC to a user who is using the skin you like
- Keep the NPC name but use the /npc skin command to just take the skin of a player
- Keep the NPC name but use the /npc skin command to just take your skin, then switch your back.
For example, search online for a skin you like, load it into your character first. Then relogin to the minecraft world. Set the NPC to use your skin (without the ‘l’ option). Log out, and reset your skin. Then log in again. Now your NPC will have the previous skin and you will be back to the one you normally use.
Use -l to set the skin to always update to the latest.
skin
/npc skin (-c -l(atest)) [name]
Parameters
Parameter | Description |
---|---|
l | Retrieve the latest skin for the player name. |
name | The user ID of the skin to retrieve. |
c | No idea. |
Set villager profession
Set the villager profession to FARMER:
/npc create oldmac
/npc type villager
/npc profession FARMER
If the NPC is a villager mob, changes villager profession.
profession
/npc profession [profession_name]
Parameters
Parameter | Description |
---|---|
profession_name | Villager profession. Supported professions are BLACKSMITH, LIBRARIAN, BUTCHER, FARMER, or PRIEST. |
Set animal or villager age
Set the animal or villager age to baby:
/npc create nelly
/npc type villager
/npc age baby
Modify an animal or villager NPC’s age.
age
/npc age [adult, baby, integer, -l]
Parameters
Parameter | Description |
---|---|
adult | Set age to adult. |
baby | Set age to baby. |
integer | Specifies an exact age. |
l | Toggles whether the age is locked. |
Add a trait or behavior
Traits are add-on personality packs such as sentinel and npcdestinations. When these additional plugins are installed they can give additional personality traits. For example the Sentinel plugin enables NPCs to guard players or areas and attack selected mobs. The NPCDestinations plugin gives your NPCs location and time based personalities such as going to work during the day and heading home at night.
These plugins must be installed into the server to work.
Behaviors are script files that are installed into the NPC plugin folder. Some examples of scripts can be found at the Citizens Script Repo or the mcmonkey studios. We are not using any of these though.
Add a trait
Make an NPC a Sentinel
/npc create knight
/npc select knight
/trait sentinel
/npc equip
Right-click NPC with the weapon or armor
Remove the sentinel trait from the NPC:
/npc select knight
/trait remove sentinel
Set the NPC to use an available trait. After an NPC is assigned to a trait, additional options become available for that NPC. For example, after setting an NPC trait to sentinel, you could use the command /sentinel addtarget MONSTERS to tell that NPC to target nearby monsters. See the sentinel or NPCDestinations instructions for more information.
The installed traits are:
- Sentinel
- NPCDestinations
trait
/trait add|remove [trait_name]
Parameters
Parameter | Description |
---|---|
trait_name | Name of trait. |
Sentinel character
The Sentinel plugin enables NPCs to guard players or areas and attack selected mobs.
After you set the NPC trait to sentinel the sentinel commands are enabled for that NPC. More information about Sentinels can be found on this website.
Set the NPC to chase monsters and give it a weapon.:
/npc select knight
/trait sentinel
/npc equip
Right-click NPC with the weapon or armor
/sentinel addtarget MONSTERS
Set the NPC to use the sentinel trait and tell it to guard a player named Bob:
/npc select knight
/trait sentinel
/sentinel guard Bob
Get information about the sentinel settings for an NPC
/npc select soldier1
/npc
Verify the NPC has the sentinel trait
/sentinel info
/sentinel targets
Set two NPCs to attack anyone holding a sword:
/npc create Thing1
/npc select Thing1
/trait add sentinel
/sentinel addtarget helditem:.*sword
/npc equip
Hold a sword and right click on the NPC
/npc create Thing2
/npc select Thing2
/trait add sentinel
/sentinel addtarget helditem:.*sword
/npc equip
Hold a sword and right click on the NPC
Sentinel commands
- /sentinel accuracy OFFSET - Sets the accuracy of an NPC.
- /sentinel addignore TYPE - Ignores a target.
- /sentinel addtarget TYPE - Adds a target.
- /sentinel armor ARMOR - Sets the NPC’s armor level.
- /sentinel attackrate RATE [‘ranged’] - Changes the rate at which the NPC attacks, in ticks. Either ranged or close modes.
- /sentinel autoswitch - Toggles whether the NPC automatically switches items.
- /sentinel chaseclose - Toggles whether the NPC will chase while in ‘close quarters’ fights.
- /sentinel chaserange RANGE - Changes the maximum distance an NPC will run before returning to base.
- /sentinel chaseranged - Toggles whether the NPC will chase while in ranged fights.
- /sentinel damage DAMAGE - Sets the NPC’s attack damage.
- /sentinel drops - Changes the drops of the current NPC.
- /sentinel enemydrops - Toggles whether enemy mobs of this NPC drop items.
- /sentinel fightback - Toggles whether the NPC will fight back.
- /sentinel forgive - Forgives all current targets.
- /sentinel greeting GREETING - Sets a greeting message for the NPC to say.
- /sentinel greetrange RANGE - Sets how far a player can be from an NPC before they are greeted.
- /sentinel guard (PLAYERNAME) - Makes the NPC guard a specific player. Don’t specify a player to stop guarding.
- /sentinel healrate RATE - Changes the rate at which the NPC heals, in ticks.
- /sentinel health HEALTH - Sets the NPC’s health level.
- /sentinel help - Shows help info.
- /sentinel info - Shows info on the current NPC.
- /sentinel invincible - Toggles whether the NPC is invincible.
- /sentinel kill - Kills the NPC.
- /sentinel needammo - Toggles whether the NPC will need ammo.
- /sentinel range RANGE - Sets the NPC’s maximum attack range.
- /sentinel reach REACH - Sets the NPC’s reach (how far it can punch.)
- /sentinel realistic - Toggles whether the NPC should use “realistic” targeting logic (don’t attack things you can’t see.)
- /sentinel removeignore TYPE - Allows targeting a target.
- /sentinel removetarget TYPE - Removes a target.
- /sentinel respawn - Respawns the NPC.
- /sentinel respawntime TIME - Changes the time it takes for the NPC to respawn, in ticks.
- /sentinel safeshot - Toggles whether the NPC will avoid damaging non-targets.
- /sentinel spawnpoint - Changes the NPC’s spawn point to its current location, or removes it if it’s already there.
- /sentinel speed SPEED - Sets the NPC’s movement speed modifier.
- /sentinel squad SQUAD - Sets the NPC’s squad name (null for none).
- /sentinel stats - Shows statistics about the current NPC.
- /sentinel targets - Shows the targets of the current NPC.
- /sentinel targettime TIME - Sets the NPC’s enemy target time limit.
- /sentinel warning WARNING - Sets a warning message for the NPC to say.
Sentinel notes
• Damage value for a Sentinel NPC can be set to “-1” to auto-calculate from held item (otherwise, it will used as a raw HP damage amount). • Armor value can be set to “-1” to auto-calculate from equipped armor (otherwise, set a value between 0.0 and 1.0 to indicate how much of any damage will be blocked).
Resetting Sentinel locations:
- use “/npc path” to set their return-to point
- use “/sentinel spawnpoint” to set where they respawn at
- be sure to set “/npc pathrange” and “/sentinel chaserange” to appropriate values (pathrange should always be higher than chaserange to ensure they can return to their path location properly)
Sentinel targets
These are all valid targets and ignores:
- Primary set: NPCS, OWNER, PASSIVE_MOB, MOBS, MONSTERS, PLAYERS, PIGS, OCELOTS, COWS, RABBITS, SHEEP, CHICKENS, HORSES, MUSHROOM_COW, IRON_GOLEMS, SQUIDS, VILLAGER, WOLF, SNOWMEN, WITCH, GUARDIANS, SHULKERS, CREERERS, SKELETONS, ZOMBIES, MAGMA_CUBES, ZOMBIE_PIGMEN, SILVERFISH, BATS, BLAZES, GHASTS, GIANTS, SLIME, SPIDER, CAVE_SPIDERS, ENDERMEN, ENDERMITES, WITHER, ENDERDRAGON
- Also allowed: player:NAME(REGEX), npc:NAME(REGEX), entityname:NAME(REGEX), helditem:MATERIALNAME(REGEX), group:GROUPNAME(EXACT)
- Also, event:pvp/pvnpc/pve/pvsentinel
- Also, sbteam:SCOREBOARD_TEAM_HERE
- Also, healthabove:PERCENTAGE and healthbelow:PERCENTAGE
- Also, permission:PERM.KEY
- Also, squad:SENTINEL_SQUAD_NAME
- Also anything listed in the integrations section above!
Sentinel invulnerable only to players
Set the sentinel to ignore players (“/sentinel addignore players”), then enable “protected” config option - find:
Whether NPCs are protected from damage by ignore targets. protected: false
in your config and set it to true instead of false (then restart server).
That will cause Sentinel NPCs to only take damage from non-ignored targets - and since we added ‘players’ to ignore, the Sentinel won’t take damage from players but will take damage from everything else!
NPC Destinations character
The NPCDestinations plugin gives your NPCs location and time based personalities such as going to work during the day and heading home at night.
After you set the NPC trait to npcdestinations the npcdestinations commands are enabled for that NPC. You can quickly set the NPC to use NPC Destinations using the /npcdest autoset command.
NPC Destinations enables most commands through its interface in the chat window. You can click on the features in the chat window to set them directly in the chat window. To reopen that chat dialog use the command /npcdest info More information about NPC Destinations, including videos, can be found on this website.
For example, create an NPC that has a morning and night location:
/npc create worker1
/npcdest autoset
Go to the morning location
/npcdest addlocation sunrise
Go to the evening location
/npcdest addlocation sunset
/waypoint provider npcdestinations
/npcdest info
Once you set destinations you can add some extra options such as:
- Wandering distance from an endpoint
- Selecting the block types the NPC can walk on
- Give names to locations
- Set up commands to send an NPC to named locations
- Set time of day to call the NPC to a destination
- Set weather to call the NPC to a destination
- Set probability that a location will be used as a destination
Some NPC Destination tips
Here are some quick gotchas that might slow your testing down:
- Characters using NPC Destinations require time to change. If it is always daylight they will not move.
- A default “Pause for players” is set to 5 blocks… so if you are standing next to them they will not do any actions.
- Multiple paths to a location can confuse the pathfinder.
- When setting blocks that an NPC can walk on, use the center button on your mouse to grab a copy of whatever block you are pointing at.
To help understand the pathfinding consider activating /npcdest debug. This mode enables you to see the pathfinding attempts and hopefully track down where a path fails. You can visually see the NPC calling out for a location to make a path to.
Animations
When this plugin is running you can set the following actions to occur when the NPC arrives at a location set by NPC Destinations.
- Fishing Animation:
- Uses the minecraft system to watch for fish biting, not just some random pull in of the line.
- Provides the ability to store the fish caught in the NPCs inventory. (FISH_ADD)
- Chest Animation:
- Opens the chest based on the locations yaw
- With CHEST_FILL it will store the extra inventory from the NPC into the chest if there is room.
- Sleeping Animation:
- Based on the direction you look when you set the addlocation or locloc command, the NPC will sleep on any surface.
- Sitting Animation
- The NPC will sit on pretty much any blocks you tell it.
- Swing Animation
- You can now have the NPC swing it’s arm at the interval you wish (500 = /12 second, 2000 = 2 Seconds, etc..)
NPC Destinations Location Commands
To see the syntax for the commands, type /npcdest in the chat window and hover the mouse over a command.
- /npcdest addlocation <0-24000|sunrise|sunset|never> —npc # Adds the current location you are standing at to the NPC then opens the editing menu
- /npc blockstick — npc # Gives you a stick to add and remove blocks with
- /npcdest locaddcmd
[command] –npc # Add a command to a location. Longer commands put them into a book and it will pull from there. - /npcdest localias
–npc # Set the alias name for this location - /npcdest loccommands - Manage commands processed upon arrival at each location
- /npcdest locdelcmd
–npc # Delete a command assigned to a location - /npcdest locinv
<–clear> –npc # Sets the NPC’s inventory for a location - /npcdest locloc
–npc # Set the coordinates for this location - /npcdest locmax
Configure the maximum distance the NPC can go from the current location - /npcdest locpause
–npc # Configure the distance an NPC will pause and wait for players - /npcdest locprob
–npc # Configure the settings for probability - /npcdest locskin
–npc # Set the skin texture for this location - /npcdest loctime
- /npcdest locwand
–npc # Configure the settings for the wandering setting - /npcdest locweather
–npc # Sets the weather allowed for a location - /npcdest removelocation # —npc # Remove a location from the selected NPC
NPC Destinations Config Commands
- /npcdest addblock - Adds the current block you are holding in your hand to the NPC’s allowed list of walkable blocks
- /npcdest autoset - Auto setup the NPC for use with NPC Destinations
- /npcdest blocksunder - Sets the number of blocks under the NPC to look for the path
- /npcdest citizens - Allows setting the Citizens defaults for the selected NPC
- /npcdest debug - Will cause the plugin to spit out information on each NPC to your chat window
- /npcdest enableplugin - Enable a plugin for use on locations for this NPC
- /npcdest goloc - Force an NPC to go to a location and stay the requested time (seconds)
- /npcdest info - Gives status details on the currently selected NPC, as well as settings
- /npcdest maxprocessing - Modify the maximum allowed time this NPC can search for a path in seconds
- /npcdest opengates - Allows the NPC to open gates to pass through
- /npcdest openmetaldoors - Allows the NPC to open metal doors to pass through
- /npcdest openwooddoors - Allows the NPC to open wooden doors to pass through
- /npcdest pauseplayer - Causes the NPC to pause when players are within
of squares - /npcdest process - Enable or disable the processing for the selected NPC
- /npcdest removeallblocks - Remove all configured blocks from the NPC’s allowed list of walkable blocks
- /npcdest removeblock - Remove a block from the NPC’s allowed list of walkable blocks
Tell them what to talk about
Enable the text editor
Add some dialog to the NPC fasttalker1
/npc select fasttalker1
/npc text
Enable the text editor. Editing a NPC’s text is simple. Follow the in-game directions to add, edit, and remove text from NPCs. A NPC being a “random-talker” means that it will repeat random phrases from its list of text. If “random” is false, it will loop through the text linearly. Changing its close-talker setting by typing “close” will toggle whether a NPC talks when a player comes within 5 blocks. If close is false, the NPC will only talk when it is clicked with the configurable talk-item. If close is true, it will only talk when a player comes near.
Note that players need the citizens.npc.talk permission to hear NPCs!
text
/npc text
Creates a text entry that says “hello player_name” and the player_name is the name of the player talking with the NPC and the color of the player_name is cyan. Adds second talk message “Hi there”. The NPC is set to a close talker and random talker. So when a player approaches within 5 blocks the NPC will make a random selection of messages:
/npc select fasttalker1
Type T to enter chat mode
/npc text
Type T to enter chat mode
add
Type T to enter chat mode
hello <3> <player>
Type T to enter chat mode
add
Type T to enter chat mode
Hi there
Type T to enter chat mode
close
Type T to enter chat mode
random
Type T to enter chat mode
exit
variables <>
Parameter | Description |
---|---|
npc | NPC’s name. |
owner | NPC’s owner. |
player | Player’s name. |
world | Player’s world. |
# | Set the text color. |
color codes
Number# | Description |
---|---|
0 | BLACK |
1 | DARK BLUE |
2 | DARK GREEN |
3 | CYAN |
4 | DARK RED |
5 | PURPLE |
6 | GOLD |
7 | LIGHT GRAY |
8 | GRAY |
9 | BLUE |
a | GREEN |
b | AQUA |
c | ROSE RED |
d | LIGHT PURPLE |
e | YELLOW |
f | WHITE |
text editor commands
Command | Description |
---|---|
add | to add an entry |
edit | to edit entries |
remove | to remove entries |
close | to toggle the NPC as a close talker |
item | to set the item in hand pattern |
range | to toggle the talking range |
delay | to set the talking delay in ticks |
random | to toggle the NPC as a random talker |
exit | to clost the text editor |
Equip them
Enable the equipment editor
Equip NPC guard1
/npc select guard1
/npc equip
Right-click the NPC with the item you want them to hold or wear
/npc equip to disable the editor
Enable the equipment editor.Toggle equipment editor. see Equipment Editor Used for player armor, player and endermen items, sheep color/sheared, and pig saddles. Equipment are things like armor, held-items, and other visible features on NPCs. Only some NPC types can have their equipment edited.
equip
/npc equip
Humans (regular NPCs)
Human NPCs can have their armor and held item modified. To give armor to a NPC, right-click one with armor in your hand. The armor is placed on the NPC’s body. Any item or armor that was previously on a NPC will be removed and dropped to the ground. To place armor in a NPC’s hand, crouch and right-click. To clear all items, right-click the NPC with no items in your hand.
To put an object in thier offhand, hold the object to give (such as a shield). Then go back to the chat screen and type “offhand”.
If you want to access their inventory you must first despawn the NPC and then use /npc inventory on them. Then, when the inventory is the way you want you can respawn the NPC with the command /npc spawn. When the NPC is already spawned you can only view their inventory but not add things to them.
Endermen
Enderman NPCs can have their carried material modified. The only valid materials that an enderman can hold are blocks - most items do not appear on the client. Note that certain “utility” blocks such as sign posts, silverfish blocks, etc. do not appear on the client either. Click with no items in your hand to remove blocks from the enderman NPC.
Sheep
Sheep NPCs can have their wool color and sheared status modified. To shear, right-click with shears like your normally would. To un-shear a sheep NPC, click it with the shears again. To change the wool color, click the sheep NPC with dye. Clicking with anything but dye in your hand will turn the sheep NPC white and drop the dye on the ground.
Pigs
Pig NPCs can have saddles added and removed from them. Simply right-click the pig NPC with a saddle in hand. Clicking with any other item in your hand will remove the saddle from the pig NPC.
Set movement options
The waypoint provider manages movement between waypoints (destinations). You use the path editor to set the destinations for the NPC to move towards (how the NPC gets to the destination is decided by the waypoint provider).
The default waypoint provider is set to Linear, going from one diestination to the next, always in the same order.If you are okay with that method of moving you can go right to /npc path to start editing a Linear set of destinations for your NPC.
If you want to use a different method to move you must select a different waypoint provider first, such as wander or guided. Then you can use /npc path to set the destination points.
Select a waypoint provider
Display available waypoint providers:
/npc select whitewalker
/waypoint provider -d
Set the waypoint provider to wander anywhere:
/npc select whitewalker
/waypoint provider wander
Disable waypoint teleporting when the NPC cannot get a path to the next waypoint:
/npc select whitewalker
/waypoint disableteleport
waypoint
/waypoint (disableteleport) | (provider [provider_name])
/waypoint provider -d)
The following waypoint providers are included with the NPCs:
- Linear (default) - Sends the NPC to each stored waypoint in sequence, one after the other.
- Wander - The NPC wanders around randomly.
- Guided - The waypoints are split into destination waypoints and guide waypoints. Destination waypoints are chosen randomly and pathed to using a combination of the guide waypoints.
Trait based waypoint providers are available with some traits, such as NPC Destinations. NPC Destinations does not use the /npc path editor to set waypoints. Use the /npcdest commands to set waypoints when using this trait.
For the linear waypoint provider, triggers can be added to pause the NPC at certain waypoints, change their speed or say something at a waypoint. More information can be found by typing ‘triggers’ in the waypoint editor.
Parameters
Parameter | Description |
---|---|
disableteleport | Stops NPCs from automatically teleporting the end of their path if they get stuck. |
provider | Name of current waypoint provider. |
provider_name | Name of waypoint provider. Default [linear |
d | Name of available providers. |
Use the path editor
Left click to add a waypoint, right-click to remove, mousewheel or number keys to select individual waypoints. NPC movement to a waypoint is managed by a waypoint provider. If you have problems getting paths to go the way you want, you can set the Citizens plugin debug-pathfinding: true. This is set in the config.yml for Citizens. When this is enabled you can see the paths that an NPC has decided to follow.
Open the path editor for MrHeavyFoot, using the default waypoint provider
/npc create MrHeavyFoot
/npc select MrHeavyFoot
/npc path
path
/npc path
Toggle path editor. Options change depending on the selected waypoint provider.
Wander waypoint provider
Set the NPC to wander in a region:
/npc select friend1
/waypoints provider wander
/npc path
Type T to enter chat mode
xrange 10
Type T to enter chat mode
regions
Left-click somewhere to be the center of the region
Type T to enter chat mode
regions
/npc path
Use wander waypoint provider to define a space where the NPC can wander randomly. After setting the waypoint provider to ‘wander’ use the /npc path command to open the editor.
Path commands for wander waypoint provider
Command | Description |
---|---|
xrange (number) | modify the x random wander range |
yrange (number) | modify the y random wander range |
regions | enter the region editor |
Wander regions editor
Left-click to add a new wanderable region using the xrange / yrange box centered at that block. Right-click an existing marker to remove that region. Type ‘regions’ to stop or simply exit the editor. Regions should be overlapping with each other.
Linear waypoint provider
Use linear waypoint provider to just go around adding waypoints. The NPC will go to each one, one after the other. After setting the waypoint provider to ‘linear’ use the /npc path command to open the editor.
After adding a waypoint you can optionally add triggers for the waypoint. For example, you can add a delay at the last waypoint to make the NPC halt for a few seconds before continuing on their way.
Add multiple linear waypoints:
/npc select friend1
/waypoints provider linear
/npc path
Left-click to add a waypoint in the ground
Walk a ways away
Left-click to add a waypoint in the ground
/npc path
NPC will walk back and forth between the points. If you add a small wall they will walk around it.
Add a waypoint with trigger to delay for 2 seconds:
/npc select friend1
/waypoints provider linear
/npc path
Left-click to add a waypoint in the ground
Walk a ways away
Left-click to add a waypoint in the ground
Type T to enter chat mode
triggers
Type T to enter chat mode
add
Type T to enter chat mode
delay
Type T to enter chat mode
40
Type T to enter chat mode
back
/npc path
Path commands for linear waypoint provider
Command | Description |
---|---|
left-click | add a waypoint |
right-click | remove a waypoint |
toggle path | toggle showing entities at waypoints |
triggers | enter trigger editor and display current triggers |
clear | clear all waypoints |
Linear trigger editor
Triggers can be added to pause the NPC at certain waypoints, change their speed or say something at a waypoint.
Type ‘add’ to begin adding triggers and ‘remove’ to remove triggers. Type triggers to exit the waypoint editor. Valid trigger names are:
Command | Description |
---|---|
delay | Add a delay trigger. Then type in the server ticks to use (20 ticks = 1 sec). |
chat | Add a chat trigger. Then type radius |
teleport | Add a teleport trigger. Then enter the destination in the format world:x:y:z. Type ‘here’ to use your current location. |
speed | Add a speed trigger. Then type the speed modifier as a percentage of its base speed. |
animation | Add an animation trigger. Then type in the animation to perform. Valid animations are ARM_SWING, ARM_SWING_OFFHAND, CRIT, EAT_FOOD, HURT, MAGIC_CRIT, SIT, SLEEP, SNEAK, START_ELYTRA, START USE_MAINHAND_ITEM, START_USE_OFFHAND_ITEM, STOP_SITTING, STOP_SLEEPING, STOP_SNEAKING, STOP_USE_ITEM. Then type ‘finish’ to finish animation trigger. |
back | Return to the edit prompt |
Guided waypoint provider
Add random destinations with guided waypoints:
/npc select friend1
/waypoints provider guided
/npc path
Sneak and left-click to add a waypoint in the ground
Walk a ways away
Sneak and left-click to add a waypoint in the ground
Walk a ways away
Sneak and left-click to add a waypoint in the ground
Walk a ways away
Sneak and left-click to add a waypoint in the ground
/npc path
NPC will randomly choose from these destinations and walk to it.
Use guided waypoint provider to define multiple destinations that an NPC will randomly choose from. After setting the waypoint provider to ‘guided’ use the /npc path command to open the editor. Guided waypoints are specifically when you want a generalised path to stick to but do not want the NPC to follow a set order. They also use the new pathfinder so can be more glitchy - there’s a debugging setting if you really want to set this up.
We do not know what the “guided” waypoints do (the NPC never goes to them), but if you set the destination waypoints (left-click while sneaking) your NPC will move randomly among those points. This is different than the linear waypoint provider where your NPC vists one destination after the other. Also, the linear waypoints supported triggers for actions when arriving at a destination.
Path commands for guided waypoint provider
Command | Description |
---|---|
left-click | add a guide waypoint |
right-click | remove an existing guide waypoint |
sneak + left-click | add a destination waypoint |
sneak + right-click | remove an existing destination waypoint |
toggle path | toggle showing entities at waypoints |
Other movement commands
- /npc anchor (–save [name]|–assume [name]|–remove [name]) (-a)(-c) - Changes/Saves/Lists NPC’s location anchor(s)
- /npc pathrange [range] - Sets an NPC’s pathfinding range
- /npc pathopt –avoid-water|aw [true|false] –stationary-ticks [ticks] –attack-range [range] –distance-margin [margin] - Sets an NPC’s pathfinding options
Add mob dependent options
General commands
Mount a rider on a horse
/npc create horsey
/npc type horse
/npc controllable
/npc horse --color brown
/npc
Take the horsey id number and use below
/npc create rider
/npc select rider
/npc lookclose
/npc mount --onnpc <id>
/waypoint provider wander
Putting wander on the horse seems to make it spin around...
more than putting wander on the rider.
To stop the wandering just set the waypoint provider to none.
/waypoint provider none
Some common commands are:
- /npc age [age] |(-l) - Set the age of a NPC
- /npc collidable - Toggles an NPC’s collidability
- /npc playerlist - Toggles an NPC as a ‘real’ player, so that it will be more recognised by other plugins, will keep chunks loaded and crops ticking.
- /npc lookclose - Toggle whether a NPC will look when a player is near
- /npc passive (–set [true|false]) - Sets whether an NPC damages other entities or not
- /npc targetable - Toggles an NPC’s targetability
- /npc vulnerable (-t) - Toggles an NPC’s vulnerability
- /npc controllable|control (-m(ount),-y,-n,-o) - Toggles whether the NPC can be ridden and controlled. Controllable NPCs can be right clicked to be mounted and controlled with WASD. Ghasts, Blazes and Endersragons can be flown by left clicking once mounted to pause/unpause flying.
- /npc flyable (true|false) - Toggles or sets an NPC’s flyable status
- /npc leashable - Toggles leashability
- /npc mount (–onnpc
) - Mounts a controllable NPC - /npc swim (–set [true|false]) - Sets an NPC to swim or not
Mob specific
Change the horse color
/npc create horsey
/npc type horse
/npc controllable
/npc horse --color brown --style white_dots
Change the parrot color
/npc create birdy
/npc type parrot
/npc parrot --variant green
Change the fish color
/npc create fishy
/npc type tropicalfish
/npc tfish --color black --patterncolor white
Create a red sitting cat
/npc create kitty
/npc type ocelot
/npc ocelot -–type red_cat -s
- /npc horse (–color color) (–type type) (–style style) (-cb) - Sets horse modifiers. Styles are: none, white, whitefield, white_dots,black_dots. -c enables carrying a chest, -b disables carying a chest.
- /npc llama (–color color) (–strength strength) - Sets llama modifiers. Supported colors include: creamy, white, brown, and gray.
- /npc minecart (–item item_name(:data)) (–offset offset) - Sets minecart item
- /npc ocelot (–type type) (-s(itting), -n(ot sitting)) - Set the ocelot type of an NPC and whether it is sitting. Ocelot type include: wild_ocelot, black_cat, red_cat, siamese_cat.
- /npc parrot (–variant variant) - Sets parrot modifiers. Variants are red, blue, green, cyan, gray.
- /npc phantom (–size size) - Sets phantom modifiers
- /npc pufferfish (–state state) - Sets pufferfish modifiers
- /npc rabbittype [type] - Set the Type of a Rabbit NPC. Supported rabbit types include: brown, white, black, black_and_white, gold, salt_and_pepper, the_killer_bunny.
- /npc sheep (–color [color]) (–sheared [sheared]) - Sets sheep modifiers
- /npc shulker (–peek [peek] –color [color]) - Sets shulker modifiers.
- /npc size [size] - Sets the Slime NPC’s size
- /npc tfish (–body color) (–pattern pattern) (–patterncolor color) - Sets tropical fish modifiers. Supported body and pattern colors include: white, orange,magenta, light_blue, yellow, lime, pink, gray, light_gray, cyan, purple, blue, brown, green, red, black. Supported patterns include: kob, sunstreak, snooper, dasher, brinely, spotty, flopper, stripey, glitter, blockfish, betty, clayfish.
- /npc wither (–charged [charged]) - Sets wither modifiers
- /npc wolf (-s(itting) a(ngry) t(amed) i(nfo)) –collar [hex rgb color|name] - Sets wolf modifiers
Manage your NPCs
Teleport to an NPC
/npc select lostnpc1
/npc tp
Change the head pose
/npc create looker1
/npc select looker1
Look in some direction
/npc pose --name lookthisway1 -a
Look at the NPC and they should now be looking...
in the direction you were
When you despawn an NPC they are kept in the memory but removed from the map. You can bring them back with the /npc spawn command. When you remove an NPC it is permanently removed from the map.
Some common commands are:
- /npc assignment –set assignment_name (-r) - Controls the assignment of a deniven script to an NPC.
- /npc copy (–name newname) - Copies an NPC
- /npc despawn (id) - Despawn a NPC
- /npc follow (player name) (-p[rotect]) - Toggles NPC following you
- /npc list (page) ((-a) –owner (owner) –type (type) –char (char) –registry (name)) - List NPCs
- /npc owner [name] - Set the owner of an NPC
- /npc pose (–save [name]|–assume [name]|–remove [name]) (-a) - Changes/Saves/Lists NPC’s head pose(s)
- /npc remove|rem (all|id|name|–owner [owner]) - Remove a NPC
- /npc rename [name] - Rename a NPC
- /npc sit (–location x,y,z,world) (–anchor anchor_name) (-c) - Makes the NPC sit.
- /npc skinlayers (–cape [true|false]) (–hat [true|false]) (–jacket [true|false]) (–sleeves [true|false]) (–pants [true|false]) - Sets an NPC’s skin layers visibility.
- /npc sleep (–location x,y,z,world) (–anchor anchor_name) - Makes the NPC sleep.
- /npc spawn (id|name) -l(oad chunks) - Spawn an existing NPC
- /npc speak message to speak –target npcid|player_name –type vocal_type - Uses the NPCs SpeechController to talk
- /npc stand - Makes the NPC stand.
- /npc tp - Teleport to a NPC
- /npc tphere - Teleport a NPC to your location
- /npc tpto [player name|npc id] [player name|npc id] - Teleport an NPC or player to another NPC or player
- /npc wakeup - Makes the NPC wake up.
Go crazy
Make a ridable turtle
/npc create bigshell --type turtle
/npc controllable
Then right click on it to ride it in the ocean.
If it dives too deep you will slide off though.
Make a guardian chicken
/npc create hero --type chicken
/npc select hero
/trait sentinel
/sentinel guard <your name>
Control a giant
/npc create bigboy --type giant
/npc select bigboy
/npc controllable
Then right click on it and walk the big guy around.
Give a llama a nice blanket. Riding the llama though will remove the blanket.
/npc create llama1 --type llama
/npc select llama1
/npc equip
Then right click on it while holding a carpet.
/npc equip
Ride a polar bear
/npc create bearbear
/npc select bearbear
/npc type polar_bear
/npc controllable
Then right click on it and guide it around.
Make a trader on a boat (uhm, work in progress, it does not work yet… better to ride a turtle)
/npc create boat
/npc select boat
/npc type boat
/npc controllable
/npc pathopt --avoid water false
Use /npc list to find the id number of the boat.
/npc create trader
/npc select trader
/npc pathopt --avoid water false
/npc lookclose
/npc mount --onnpc <id>
Here are some ideas of what you can do with NPCs.
- Make a ridable turtle
- Make a guardian chicken
- Control a giant
- Give a llama a nice blanket. Riding the llama though will remove the blanket
- Ride a polar bear
Sample script for NPC dialog here: https://interpixel.dyndns.org/docs/npc_chat_script_simple.txt
All Commands
- /npc - Show basic NPC information
- /npc age age - Set the age of a NPC
- /npc anchor (–save [name]|–assume [name]|–remove [name]) (-a)(-c) - Changes/Saves/Lists NPC’s location anchor(s)
- /npc armorstand –visible [visible] –small [small] –gravity [gravity] –arms [arms] –baseplate [baseplate] - Edit armorstand properties
- /npc assignment –set assignment_name (-r) - Controls the assignment of Denizen script to an NPC.
- /npc bossbar –color [color] –title [title] –visible [visible] –flags [flags] - Edit bossbar properties
- /npc collidable - Toggles an NPC’s collidability
- /npc controllable|control (-m(ount),-y,-n,-o) - Toggles whether the NPC can be ridden and controlled
- /npc copier - Toggle the NPC copier
- /npc copy (–name newname) - Copies an NPC
- /npc create name –b (behaviours)) - Create a new NPC
- /npc despawn (id) - Despawn a NPC
- /npc equip - Toggle the equipment editor
- /npc flyable (true|false) - Toggles or sets an NPC’s flyable status
- /npc follow (player name) (-p[rotect]) - Toggles NPC following you
- /npc gamemode [gamemode] - Changes the gamemode
- /npc glowing –color [minecraft chat color] - Toggles an NPC’s glowing status
- /npc gravity - Toggles gravity
- /npc horse (–color color) (–type type) (–style style) (-cb) - Sets horse modifiers
- /npc id - Sends the selected NPC’s ID to the sender
- /npc inventory - Show’s an NPC’s inventory. If the NPC is despawned, you can also edit the inventory.
- /npc item item - Sets the NPC’s item
- /npc leashable - Toggles leashability
- /npc list (page) ((-a) –owner (owner) –type (type) –char (char) –registry (name)) - List NPCs
- /npc llama (–color color) (–strength strength) - Sets llama modifiers
- /npc lookclose - Toggle whether a NPC will look when a player is near
- /npc metadata set|get|remove key (-t(emporary)) - Manages NPC metadata
- /npc minecart (–item item_name(:data)) (–offset offset) - Sets minecart item
- /npc mount (–onnpc < npc id>) - Mounts a controllable NPC
- /npc moveto x:y:z:world | x y z world - Teleports a NPC to a given location
- /npc name - Toggle nameplate visibility
- /npc ocelot (–type type) (-s(itting), -n(ot sitting)) - Set the ocelot type of an NPC and whether it is sitting
- /npc owner [name] - Set the owner of an NPC
- /npc parrot (–variant variant) - Sets parrot modifiers
- /npc passive (–set [true|false]) - Sets whether an NPC damages other entities or not
- /npc path - Toggle the waypoint editor
- /npc pathopt –avoid-water|aw [true|false] –stationary-ticks [ticks] –attack-range [range] –distance-margin [margin] - Sets an NPC’s pathfinding options
- /npc pathrange [range] - Sets an NPC’s pathfinding range
- /npc phantom (–size size) - Sets phantom modifiers
- /npc playerlist (-a,r) - Sets whether the NPC is put in the playerlist
- /npc pose (–save [name]|–assume [name]|–remove [name]) (-a) - Changes/Saves/Lists NPC’s head pose(s)
- /npc power - Toggle a creeper NPC as powered
- /npc profession|prof [profession] - Set a NPC’s profession
- /npc pufferfish (–state state) - Sets pufferfish modifiers
- /npc rabbittype [type] - Set the Type of a Rabbit NPC
- /npc remove|rem (all|id|name|–owner [owner]) - Remove a NPC
- /npc rename [name] - Rename a NPC
- /npc respawn [delay in ticks] - Sets an NPC’s respawn delay in ticks
- /npc script –add [files] –remove [files] - Controls an NPC’s scripts
- /npc select|sel id|name - Select a NPC with the given ID or name
- /npc sheep (–color [color]) (–sheared [sheared]) - Sets sheep modifiers
- /npc shulker (–peek [peek] –color [color]) - Sets shulker modifiers.
- /npc sit (–location x,y,z,world) (–anchor anchor_name) (-c) - Makes the NPC sit.
- /npc size [size] - Sets the NPC’s size
- /npc skin (-c -l(atest)) name - Sets an NPC’s skin name. Use -l to set the skin to always update to the latest
- /npc skinlayers (–cape [true|false]) (–hat [true|false]) (–jacket [true|false]) (–sleeves [true|false]) (–pants [true|false]) - Sets an NPC’s skin layers visibility.
- /npc sleep (–location x,y,z,world) (–anchor anchor_name) - Makes the NPC sleep.
- /npc sound (–death [death sound|d]) (–ambient [ambient sound|d]) (–hurt [hurt sound|d]) (-n(one)) (-d(efault)) - Sets an NPC’s played sounds
- /npc spawn (id|name) -l(oad chunks) - Spawn an existing NPC
- /npc speak message to speak –target npcid|player_name –type vocal_type - Uses the NPCs SpeechController to talk
- /npc speed [speed] - Sets the movement speed of an NPC as a percentage
- /npc stand - Makes the NPC stand.
- /npc swim (–set [true|false]) - Sets an NPC to swim or not
- /npc targetable - Toggles an NPC’s targetability
- /npc text - Toggle the text editor
- /npc tfish (–body color) (–pattern pattern) (–patterncolor color) - Sets tropical fish modifiers
- /npc tp - Teleport to a NPC
- /npc tphere - Teleport a NPC to your location
- /npc tpto [player name|npc id] [player name|npc id] - Teleport an NPC or player to another NPC or player
- /npc type [type] - Sets an NPC’s entity type
- /npc vulnerable (-t) - Toggles an NPC’s vulnerability
- /npc wakeup - Makes the NPC wake up.
- /npc wither (–charged [charged]) - Sets wither modifiers
/npc wolf (-s(itting) a(ngry) t(amed) i(nfo)) –collar [hex rgb color|name] - Sets wolf modifiers
/trait remove [trait name]… - Removes traits on the NPC
/trait add [trait name]… - Adds traits to the NPC
/trait trait name - Configures a trait
/trait [trait name], [trait name]… - Toggles traits on the NPC
/template list - Lists available templates
/template apply template name - Applies a template to the selected NPC
/template create template name - Creates a template from the selected NPC
/template delete [template name] - Deletes a template
/waypoint disableteleport - Disables teleportation when stuck (temporary command)
/waypoint provider provider name - Sets the current waypoint provider
/citizens - Show basic plugin information
/citizens save (-a) - Save NPCs
/citizens reload - Reload Citizens