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.
@ryanwagner
Darn concurrent modifications ! It occurs with (bad) multi-threading coding. My bad. But, the sheep sheering thing ?? I'm invoking getEntitiesByClass(Villager.class). How a sheep can be there ? A villager in disguise, perhaps ? :D
Thank you for the reporting. Never hesitate to fill a ticket so I could track this.
Edit: For the sheering thing : My bad too ! It has been spotted in 0.2.3 and corrected in 0.2.4. I'm working in the concurrent modification right now.
Updated to 0.2.4 and I am getting the same error:
2012-05-18 20:13:39 [SEVERE] java.util.ConcurrentModificationException
2012-05-18 20:13:39 [SEVERE] at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
2012-05-18 20:13:39 [SEVERE] at java.util.ArrayList$Itr.next(Unknown Source)
2012-05-18 20:13:39 [SEVERE] at org.bukkit.craftbukkit.CraftWorld.getEntitiesByClass(CraftWorld.java:579)
2012-05-18 20:13:39 [SEVERE] at org.randomgd.bukkit.workers.WorkerHandler.browseEntities(WorkerHandler.java:257)
2012-05-18 20:13:39 [SEVERE] at org.randomgd.bukkit.workers.WorkerHandler.run(WorkerHandler.java:250)
2012-05-18 20:13:39 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
2012-05-18 20:13:39 [SEVERE] at java.lang.Thread.run(Unknown Source)
I have always wanted villager to do something like this :D
Using 0.2.3 and get this error:
2012-05-18 08:45:32 [SEVERE] java.util.ConcurrentModificationException
2012-05-18 08:45:32 [SEVERE] at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
2012-05-18 08:45:32 [SEVERE] at java.util.ArrayList$Itr.next(Unknown Source)
2012-05-18 08:45:32 [SEVERE] at org.bukkit.craftbukkit.CraftWorld.getEntitiesByClass(CraftWorld.java:590)
2012-05-18 08:45:32 [SEVERE] at org.randomgd.bukkit.workers.WorkerHandler.browseEntities(WorkerHandler.java:242)
2012-05-18 08:45:32 [SEVERE] at org.randomgd.bukkit.workers.WorkerHandler.run(WorkerHandler.java:235)
2012-05-18 08:45:32 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
2012-05-18 08:45:32 [SEVERE] at java.lang.Thread.run(Unknown Source)
Also a player reporting getting a permissions error when trying to sheer a sheep. The error said they don't have permission to assign job/profession.... or something like that they said.
v0.2.4 on its way. Added the librarian. Sugar cane to book manufacturer. But more interesting, it can provide XP if you give it something to study. Here is the use case:
Meet the librarian. Give him a "weird item" (glowstone dust, ghast tear, see the wiki). It will say to you something like "Nice ! I'll study that !". If there's bookshelves near it, it will study. The more bookshelf, the quicker the study. After some time (depending on the item to study), if you meet the librarian again (i.e if you're close enough to it), it will say to you "I'm done with the study ! Here is your reward : N XP".
The reward can vary because the study can be more or less successful.
If you try to give another item will a study is ongoing, the librarian will tell you that it's already studying something for you. A librarian can study for several player simultaneously. I plan to implement the notion of "busyness".
@ryanwagner
Thx for the tips. My (noob) mistake for the permissions here. Concerning the config.yml, default values are set in the jar and can be overrode by setting your own values in the pugins/UsefulVillagers/config.yml file.
As said in the documentation (the link at the end of the usage paragraph), use a wood block to mark a tree.
Permission tag will be changed for the next release.
can you please change the permission to usefulvillagers.jobassign so that it fits with the permission scheme everyone else uses :)
also the config.yml is not being automatically generated for me on server start. Although i do see it in the jar
Also, how do you "mark" a tree?
v0.2.3 uploaded. Awaiting validation from our beloved moderators.
@batlham
I love the idea of smelting service for the blacksmith. The marking you're suggesting is implemented in the upcoming v0.2.3.
I love the concept!! Something you might want to add to the blacksmith is smelting any ore in chests near a furnace and placing product from the furnace to chests. Looks like it is not far off from making charcoal.
Going to try this mod once I have a villager village :)
It would be nice to replant trees. Since you are using a brick block under grass a tree farm would be nice :)
I'm currently finishing the tests on the 0.2.1. The code is better looking, the farmer job is more coherent. The librarian job has disappeared. The next step before delivery is the documentation (which is not the nicest part to do, with all the screenshots). Configuration has been added, permissions too. I do my best to deliver this asap.
@Knee97
In the case of librarian, you just have to put a red brick block below the dirt/grass block supporting the birch tree to be cut.
How can I mark a tree for cutting? Is there a special tool, like the wooden axe?
@Zefram
On my way.
please add Permissions node
thanks
Citizens is different. The Citizens do not spawn naturally...they are not villagers. You have to create each Citizen, equip them and then give them a bunch of parameters for operation. You can create guards outside a house and have the guards attack all players, or just mobs or just stand there doing nothing. So it's not the same thing as stumbling upon a village full of villagers who do something useful like manufacture iron pickaxes when they have enough iron or iron ore.
I think Useful Villagers could be used on any type of server, while Citizens would be useful on an RPG server so you can have quest NPCs and the like.
Just my thoughts on Citizens and Useful Villagers.
@Knee97
Normal spawned. I'm not familiar with the bukkit community. After looking at the Citizens plugin, I was like "Oh, it's already done. Let's shut my plugin off. No need to duplicate." It seems that they're developing an API that could allow doing what my plugin is doing. Well, if it's the case, my plugin doesn't mean to exist.
What villagers do you mean? From the Plugin Citizens or normal spawned?
@whistlelblower
Unfortunatly, given the bukkit API, I can't order a villager to stand outside a house and defend it with a sword.
The "limit idea", or villager stone is a way I'm currently exploring. Thank you for the suggestions.
(PS : The moderation is still pending).
Suggestions:
Give villagers a sword, and at night instead of going into a home they stand at the doorway on the outside, guarding the villagers inside from any zombies that might wander by.
As for your marking behaviour, why not make it boundary based ? You can make it command free by using Lapis Blocks (or similar rarity) become Villager Stones. Any villagers that are within x blocks of the lapis block have their routines altered and will perform their assigned jobs within that area only. Remove the lapis block, they return to normal villagers.
@lizardbones
Wow, that's some great suggestions. The farming template is something scheduled. It will be kinda painful (no thinking about it right now). The farmer are a bit "crazy" when it comes to grow wheat due to the random nature of their movements. Keep tools away from them if you want to avoid this. Or only use dirt/grass for farming purpose and decorate the rest with gravel/sand/etc.
I'm currently coding blacksmiths. They are planned to produce charcoal out of wood they cut. There's a plan about tool production. Tool repair is tricky, I guess (from the mechanics point of view). Of course, no enchantment involved !
About economy, it's also a bit tricky to incorporate a notion like this one. I tend to keep stuff as simple as possible ;p But as you can see, this plugin is licensed into public domain, so, feel free. Fork and do whatever your imagination commands to you !