The Wandering NPC 1.8

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

  1. Nutty101
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    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.

    • 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

    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​

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

    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:
    * 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.

    My GitHub

    Victhetiger, Azfaloth, iRaphi and 4 others like this.

Recent Reviews

  1. Luke135
    Version: 1.8
    Such a good plugin. Five starts. I don't know what else to say. Really good!!!!!
  2. bunny119
    Version: 1.8
    Seeing that this plugin was no longer supported, I didn't have high expectation when downloading it. But wow.... It is awesome! Much better then the default citizen's wander. The setup and commands are easy and you can configurate whatever you want. Works perfect on my 1.16.4 server!
  3. KaiWolf
    Version: 1.8
    Just an awesome plugin. Runs like about 2 years on my server (without many restarts) and never had to teleport any stuck npcs. Just brilliant
  4. vihren
    Version: 1.8
    all the commands work but my npc doensn't move at all .
    1. Nutty101
      Author's Response
      Did you use "/waypoint provider wanderingnpc" per the instructions? Also, this is for reviews, not issues.
  5. SkytAsul
    Version: 1.7
    Works very fine, I was looking for this kind of plugin for a long time.
    There is only one other thing I would like to see in this plugin : an option to make pause the NPC a few seconds randomly.
    1. Nutty101
      Author's Response
      Thanks. Sadly I have stopped updating this one as I replaced it with npc destinations. That supports the pausing.
  6. mc732
    Version: 1.7
    Can't reply to discussion anymore?
    It's old, but it still solves a problem that needs solving! The citizens wander provider is full of potential, but a basic implementation.
    Working great on Spigot 1.12.2, except for the pauseplayer command, which runs without error but has no effect.
    Edit: Never mind, they do pause, it just takes a few seconds.
    Thank you!
    1. Nutty101
      Author's Response
      Yeah, I keep this one updated with each version. Not really doing much with it, but as you said. There are people still using it, so I will keep it going. Thanks
  7. skullyking7
    Version: 1.7
    It doesnt work for me ?. i add the trait but the npc doesnt move. what are the recommended versions for 1.10 (citizens en wanderingnpc) ?
    1. Nutty101
      Author's Response
      With this plugin you need to use /waypoint provider wanderingnpc. Its really old but there are people on all versions running it, so we should be good.
  8. Adamantyte
    Version: 1.7
    Works great, developer is friendly and open-minded. The plugin does exactly what I need it to do with very little bugs.
    1. Nutty101
      Author's Response
      Thanks! This plugin is sooooo old to boot.
  9. 123hellobgbg
    Version: 1.6
    The developer is really friendly and does a lot for people. He makes one of the best plugins out there in spigot.
  10. Drehverschluss
    Version: 1.6
    Amazing works. Easy settup and more easy to understand. Very well done. I like such developers Who put more love into his project. Keep up!
    1. Nutty101
      Author's Response
      Thank you, your comment is very appreciated.