Source-checkedCreatures & NPCs

The Wandering NPC

by Nutty101 · for Minecraft

Citizens2 addon to allow NPC's to randomly wander around with settings.

13KDownloads
7 yr agoLast updated
Spigot · PaperLoaders
1.15Latest game version

About The Wandering NPC

From SpigotMC

Citizens2 addon to allow NPC's to randomly wander around with settings.

Vahlokath on the Citizens's IRC channel gave me the idea to create this plugin to extend the wander waypoint provider for citizens. The main issue was that the NPC's when set with the wander waypoint provider, they would just endlessly wander and there are no limits on how far they can go, or climb. You also have no control over the surfaces they can walk on. So this plugin semi addresses that. Keep in mind it's far from realistic on the path finding, and this whole plugin was less than an hours work.

While this project is not abandoned, it is only maintained for bugs, and to keep it working. It will not have new features added to it. For newer features please look at the NPCDestinations plugin.

Features:

  • Define a center point of reference for the NPC and designate a maximum distance they can wander from that.
  • Define the distance to look for the next destination.
    • Crowded areas, smaller can help
  • Define how far up the NPC can go in each destination decision.
    • This can help ensure the NPC does not warp, or climb up the side of buildings, etc.
  • Define the surfaces that the NPC can walk on.
  • Ability to have the NPC pause when players are within a defined radius.
  • Prevent running in circles by enabling pathing history with a configurable amount.
  • NO CONFIG files to edit and changes to each NPC are effective instantly

Usage:
Generate an NPC, and type /waypoint provider wanderingnpc. The plugin will auto assign the trait to the NPC as well as set the center point to the NPC's current location.


You can fine tune the wandering by using the following commands:
/wanderingnpc info
This shows settings on the currently selected NPC for the wanderingnpc trait.​
/wanderingnpc setcenter
Sets the centerpoint for the NPC from which it can wander out from.​
/wanderingnpc tpcenter
Teleports you to the NPC's center location.​
/wanderingnpc maxdistance
Sets the maximum distance from the center the NPC can wander​
/wanderingnpc pathdistance
Sets the maximum distance for to look for the next destination​
/wanderingnpc climbingdistance
Sets the max height up or down that the NPC can go in a single path finding event. This is not total from the center, but per attempt to move somewhere.​
/wanderingnpc pathhistory {#}
Enable or Disable the path history. Helps prevent backtracking. You can also define the # of locations to tract by adding a number to this command.​
/wanderingnpc pauseplayer {#}
Tell the NPC to pause when a player is # blocks away. 0 or blank disables this function. This is good if your NPC is a quest giver.​
/wanderingnpc addblock
Adds the blocktype selected in your hand to the allowed surfaces that the NPC can choose as a destination​
/wanderingnpc removeblock
Removes the blocktype selected in your hand from the allowed surfaces that the NPC can choose as a destination​

Permissions:
wanderingnpc.settings
This gives a user the ability to change the NPC's wander settings
wanderingnpc.tpcenter
Ability to teleport to the NPC's center /wanderingnpc tpcenter​
wanderingnpc.info
Permission to see the settings /wanderingnpc info

​
Notes:
The path finding is random and uses the same idea that was in citizens to begin with, I just expanded on that and made a trait around it for configuration. While this could be done without adding commands or a trait, I wanted the ability to change the NPC's settings live and without editing the saves.yml file.

* If you want to use the /npc path command after setting an NPC to use this. You will have to reset the waypoint provider back to the linear waypoint. Use /waypoint provider linear to reset it. You will also have to set the waypoints again.

Note from Azfaloth regarding soul sand:
<aside>
Another piece of info you should add in the description is that the npc jump height is very important for some blocks. NPCs will get stuck on things like the edges of soul sand unless the jump height is at least 2. Because soul sand is slightly smaller than normal blocks. This may lead to players reporting bugs for improper movement.
Click to expand...
</aside>

  • This plugin uses the plugin Metrics system. If you want to disable it, open /PluginMetrics/Config.yml and set opt-out to true. Mostly for my curiosity




Let me know if this is handy for anyone, if enough people chime in, I will work on a better path finding system.

Source:
My GitHub

Read the full description on SpigotMC →

Highlights

From source data

Game versions

Supports 8 Minecraft versions, the newest being 1.15.

Loaders

Runs on Spigot and Paper.

Footprint

Rated a light load on a server.

The Wandering NPC on Nxeon

From our catalogue
One-click install
Supported on Nxeon Minecraft servers, for Paper servers. We download it from SpigotMC, place it, and restart the server.
Server side
Required on the server
Server type needed
Spigot, Paper
Server load
light
Smallest plan we suggest
Minecraft — 2 GB (2 GB RAM). This follows our own load rating above, not a benchmark.
Latest build
1.8, released 2019-08-23

Game versions by loader

LoaderGame versionsNewest
Paper1.8 to 1.15 (8 versions)1.15
Spigot1.8 to 1.15 (8 versions)1.15

From 9 recorded builds of The Wandering NPC.

Recent builds

BuildReleasedGame versionsLoaders
1.82019-08-231.8 to 1.15 (8 versions)Spigot, Paper
1.72016-08-13n/aSpigot, Paper
1.62016-03-01n/aSpigot, Paper
1.62016-03-01n/aSpigot, Paper
1.52016-02-16n/aSpigot, Paper
1.42015-11-08n/aSpigot, Paper

Run The Wandering NPC on a Minecraft server

Pick a server or deploy a new one above; it is installed in one click.

What kind of mod it is

From the catalog
Listed on SpigotMC as “Plugins”

Creatures & NPCs

Adds or changes creatures, NPCs and how they behave.

Runs on your server

From source side support

SpigotMC lists The Wandering NPC as required on the server. Check its SpigotMC page to see whether players need it too.

Compatibility

Game
Minecraft
Loaders
SpigotPaper
Runs on
Serverrequired on the server
Game versions
1.15 and 7 earlier
Requires
One-click install needs a Paper server.

Verified at the source

  • ✓SpigotMCOfficial listing, checked 2026-10-02Open ↗
  • ✓AuthorNutty101, as published on SpigotMC
  • ✓LicenseNot published by the sourceFree

The Wandering NPC, answered

Generated from the mod’s own source data.

Do my players need to install The Wandering NPC?

SpigotMC lists The Wandering NPC as required on the server. Check its SpigotMC page to see whether players need it too.

Which loaders does it support?

Spigot and Paper.

Is it free?

Yes. The Wandering NPC is free to download from SpigotMC.

How do I add it to my Nxeon server?

Use “Add to a server” on this page, or open NxLabs from your dashboard. We install it, restart your server and switch it on.

NxLabs

Run The Wandering NPC on a Minecraft server.

Deploy in about a minute from $4.99 a month, then add The Wandering NPC in one click.