UsefulVillagers
RIP
Unfortunately, yeah, this plugin is dead. I've repeatedly said that I've no time left for it. The source are available but nobody's dare to maintain it, only complain that it doesn't evolve. Sorry internet, blame yourself for that. There's no charge for this plugin, I've never asked for donations. Now if you want to make it live (if it's worth it as "many other plugins are better" as i've read sometimes), use your brain, use your skills, use your own time. By now, I'm done.
Summary
This plug-in aims at adding some purpose to the villagers. Instead of walking around, villagers can also performs tasks depending on their profession. As they walk around, they will grow food, cut trees, gather sugar cane to make books, get wool, use furnaces, mine, etc.
Changelog for 0.4.0
- Added a configuration key in 'config.yml' that avoid 'not useful villagers' messages.
- Blacksmith now also cook pork (how strange it is ...).
- Various internal technical improvement.
Quote from Some Random GameDev:There's now a dependency to Gson. You'll have to download the third library jar, store it somewhere and update the -Djava.ext.dirs parameter.
Usage
First, a complete manual is available here.
Villagers professions can be set by right-clicking with the appropriate items:
- Wheat : Transforms a villager into a 'farmer'. A farmer will harvest wheat, melon and pumpkin, sugar cane.
- Book : Transforms a villager into a 'librarian'. Librarians take sugar cane from chest, use nearby workbench to produce books and put back produced books in the next encountered chest. Librarian can also 'study' weird items, such has glowstone dust, blaze powder, ghast tears, and give back experience points to players (study time depends on the given item).
- Iron ingot : Transforms a villager into a 'blacksmith'. Blacksmith with furnaces and chests in there surrounding will automatically transfer goods from furnace to chest and start smelting job from chest content. If interacted with a gold pickaxe, the blacksmith gain (or loose) mining ability (see manual for full description/usage).
- Leather : Transforms a villager into a simple 'butcher'. Butcher, for now, uses shear to collect wool from sheep.
- Glass Bottle : Transforms a villager into a 'priest'. Priest heal and defend villager (and player) with spells.
A villager can be provided with items by right-clicking on it.
- Give an hoe to a farmer and it will be able to transform dirt/grass to soil and plant seeds.
- Give seeds to a farmer to allow him planting seed.
- Give an axe to a farmer and it will be able to cut tree (if the tree is marked for cutting).
- Give sugar cane to librarian and it will craft books as soon as it cans.
- Give interesting stuff to librarian and it will study them and give back experience to you after time.
- Give shears to butcher and it will collect wool from sheep.
- Give stone or iron pickaxes to blacksmith and if it has a mining ability, it will mine below iron blocks.
- Give glowstone dust to priest and it will heal surrounding players and villagers.
- Give blaze rod to priest and it will set nearby monsters on fire (creepers/spider/skeleton/zombie).
(Extra : Give torches to a golem and it will place them in encountered dark places).
When a chest is encountered, the villagers will put their products in it (wheat, melon, pumpkin, wood logs, sugar cane, books, wool).
Disclaimer
It is not a 'active AI'. It is not experimental and rely totally on bukkit API. Hence, this plugin doesn't override villager behaviour but add some features to it. The villagers will continue to move and act as they're used to. But, periodically, player-activated villagers will modify their environment accordingly to their profession.
Roadmap
- Add priest brewing capabilities.
- Add more flexible serialization (XML or other) to allow easy migration without blasting all !
- Add blacksmith charcoal production management.
- Add butcher management (animals breeding and processing).
- Add commands for live administration.
Any suggestions are welcome.
Rejected Suggestions
First of all, keep in mind that I can't alter villagers movement.
- Fishing : Heart breaking, but it's not possible ...
- Villager self-defense : out of my range (only passive area of effet enabled via priest).
- Structure building
Commands
None for the moment. See Roadmap.
Configuration and Permissions
Again, a complete manual is available here with details concerning configuration and permissions. Check this out and read it !
Requests
Don't hesitate to report any problems or make any suggestions here.
Butcher is planed. It will need some extra dev for terrain pattern recognition (fence following etc.).
I can't act on entities movements. Hence, I can't create a super guardian. But I can make a Tesla Death Coil that struck hostile mobs with a ligthning ;p But it's not this plugin purpose. Perhaps another one.
Farmers (at least lumberjack) already put sapling when they cut trees. But they don't collect sapling, it's true. They should. Choosing where to plant a sapling is not tricky but can be very time consuming. A farmer should need to scan a big area (5x5x7 or 9) to decide if it fits. Perhaps it's time to implement some "urbanism planning" :)
you should add like a guard that attacks hostile mobs. iron golems can take a while to produce so in the meantime, guards can be used
you could also add like a butcher, a person that breeds and kills farm mobs for their meat or item(wool). or maybe a fisher that fishes for fish if there is water nearby and then stores the fish in a chest for food
Can the farmers please collect and space out the placement of saplings?
Alternatively the farmers could only place in the same location they chop down trees.
Either way I would like them to collect the saplings and use
@Shafted1971
Thank you very much. I've changed the poll and planed to implement one feature this week-end. I don't have much time during the week for coding the plugin, but I can think about it. And the more I think, the faster I code afterwards !
I'll be watching this plugin closely... I'm seriously thinking of adding this to my server. I'm thinking what I may do is sell villager eggs to my players so they can by a villager(s) to farm their farm for them... seems very cool to me (I need to fully flesh this idea out with my staff to see if this can be abused in some way... none that I can see (yet)).
Don't be discouraged by jeb adding trading to villagers, your plugin does far more than that. This takes what little is being done officially with villagers and makes them worth having on a bukkit server.
Mmm ... Villager trading ... http://twitter.com/#!/jeb_/status/204619936616808451
Will it make my plugin useless ? I have to code faster ! damnit !
@Derthmonuter
Thank you.
(btw, my comment about your plugin, MagicBookshelf, was just a try to figure it out with this 1xp stuff, not a criticism at all. As i've said, I use your plugin extensively on my own server :) ).
Got here from that somewhat critical comment you left on my plugin. Just gonna say this looks like a really neat plugin, and I'll give it a shot to get you some feedback later.
@lizardbones
First of all, thank you for this nice comment :)
Then, to change a farmer into a lumberjack (that only cut birch trees), right click on it with a sapling. A message will be displayed saying something like "Let's cut all the birch trees !".
And it brings a new improvements : Make the lumberjack cutting the 3 basic kind of trees (oak, birch and pine).
For the villagers cutting down trees, since the villagers will never leave their village area, would it be possible to have a setting where the tree cutting villagers will just cut down any tree they come across? Basically they would clear cut the area that encompasses their village. Marking individual trees just seems like a lot of work to me. But I'm lazy, so don't take that too much to heart.
Overall, I've got to say this is probably the neatest plugin for Bukkit running. It's adding something to the game that seems like it should have been there from the beginning. Villagers are, at best, set decoration. This mod might give people a reason to hang around with the annoying little buggers.
@whistlelblower
This will slow down a bit as I'm back to 'real' work (the one I get paid for) tomorrow. But the basis are set ! I'm thinking about future features, and they are big. There's obviously an improvement to do about librarians. But the very next feature will be blacksmiths, my smelting friends. I was also thinking about the priest as potion making guys (never been fed up to brew awkward potions ?). The very big feature will consist in using those passive behaviours to simulate a community, with needs and interactions (actually, there's some with farmer getting sugar cane to chest for librarian to make books). Perhaps build a local economy, with a little help of the players, as they will see an interest to hang out in villages. But many problems emerge by doing that. By now, you can take whatever is put in chests by our beloved villagers. There's no property concept, no individuals. And perhaps it's good that way. After all, it is 'UsefulVillagers', not 'RPGVillagers'.
So ! To sum up, the next two features:
No sign voodoo for the moment.
Thanks for updating this so quickly, I'm excited for the final product !
Version 0.3.0 is out and waiting for validation. No additional jobs/functionality. Just code revamp (cleaner, better :) ). Got to make a tutorial now ...
@batlham
I've done a ticket about that. The next release will correct it (if I've read and understood the wiki correctly).
version 1.2.5-R2.0
I was standing still doing nothing when it happened. Not sure what blocks were moving
@batlham
Oh c'mon ! I've corrected concurrent modification issues and it triggers this kind of error that happens only if a block is moving while a villager is scanner its area. I mean : what are the odds ?
Well, I'm learning the bukkit thread fun the hard way at every bug you guys raise :)
By the way, don't forget to precise which version of craftbukkit you're using.
using 0.2.5
2012-05-19 14:15:04 [WARNING] Could not properly handle event BLOCK_PHYSICS: java.lang.IllegalAccessError: Synchronized code got accessed from another thread : org.randomgd.bukkit.workers.WorkerHandler$2 at org.bukkit.event.Listener.onBlockPhysics(Listener:0) at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459) at net.minecraft.server.World.k(World.java:510) at net.minecraft.server.World.applyPhysics(World.java:495) at net.minecraft.server.World.update(World.java:459) at net.minecraft.server.World.setTypeId(World.java:434) at org.bukkit.craftbukkit.block.CraftBlock.setTypeId(CraftBlock.java:92)
at org.bukkit.craftbukkit.block.CraftBlock.setType(CraftBlock.java:88) at org.randomgd.bukkit.workers.info.FarmerInfo.perform(FarmerInfo.java:360) at org.randomgd.bukkit.workers.WorkerHandler.browseEntities(WorkerHandler.java:288) at org.randomgd.bukkit.workers.WorkerHandler$2.run(WorkerHandler.java:270) at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
2012-05-19 14:15:04 [INFO] This error is logged only once: it could have occurred multiple times by now. 2012-05-19 14:15:04 [INFO] Please contact one of the authors of plugin 'UsefulVillagers': Some Random Gamedev 2012-05-19 14:15:04 [WARNING] Could not properly handle event BLOCK_PHYSICS: java.lang.IllegalAccessError: Synchronized code got accessed from another thread : org.randomgd.bukkit.workers.WorkerHandler$2 at org.bukkit.event.Listener.onBlockPhysics(Listener:0) at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459) at net.minecraft.server.World.k(World.java:510) at net.minecraft.server.World.applyPhysics(World.java:496) at net.minecraft.server.World.update(World.java:459) at net.minecraft.server.World.setTypeId(World.java:434) at org.bukkit.craftbukkit.block.CraftBlock.setTypeId(CraftBlock.java:92)
at org.bukkit.craftbukkit.block.CraftBlock.setType(CraftBlock.java:88) at org.randomgd.bukkit.workers.info.FarmerInfo.perform(FarmerInfo.java:360) at org.randomgd.bukkit.workers.WorkerHandler.browseEntities(WorkerHandler.java:288) at org.randomgd.bukkit.workers.WorkerHandler$2.run(WorkerHandler.java:270) at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
2012-05-19 14:15:04 [INFO] This error is logged only once: it could have occurred multiple times by now. 2012-05-19 14:15:04 [INFO] Please contact one of the authors of plugin 'UsefulVillagers': Some Random Gamedev 2012-05-19 14:15:04 [WARNING] Could not properly handle event BLOCK_PHYSICS: java.lang.IllegalAccessError: Synchronized code got accessed from another thread : org.randomgd.bukkit.workers.WorkerHandler$2 at org.bukkit.event.Listener.onBlockPhysics(Listener:0) at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459) at net.minecraft.server.World.k(World.java:510) at net.minecraft.server.World.applyPhysics(World.java:498) at net.minecraft.server.World.update(World.java:459) at net.minecraft.server.World.setTypeId(World.java:434) at org.bukkit.craftbukkit.block.CraftBlock.setTypeId(CraftBlock.java:92)
at org.bukkit.craftbukkit.block.CraftBlock.setType(CraftBlock.java:88) at org.randomgd.bukkit.workers.info.FarmerInfo.perform(FarmerInfo.java:360) at org.randomgd.bukkit.workers.WorkerHandler.browseEntities(WorkerHandler.java:288) at org.randomgd.bukkit.workers.WorkerHandler$2.run(WorkerHandler.java:270) at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
2012-05-19 14:15:04 [INFO] This error is logged only once: it could have occurred multiple times by now. 2012-05-19 14:15:04 [INFO] Please contact one of the authors of plugin 'UsefulVillagers': Some Random Gamedev
New version on its way (v0.2.5). Ticket 1 (Concurrent modification issue) and Ticket 2 (Farmer not working when freshly assigned) are fixed.
In order to fully correct ticket 1, I've had to remove the automatic reward distribution of the librarian. Now, if you want to get your reward from a study, you'll have to directly interact with the librarian with which you've started the study.
I wonder what those librarians will do with all those items you would give them for XP reward ... :) Perhaps store them in some sort of "vault". Could be nice ...
@vasil7112
It is due to a nasty mistake of mine with serialisation management. Restart your server and your villagers will work. Sorry for that. I'll post a new version soon.
For some reason my farmers don't want to work:D Could you make a video please?