UVVillagers
Note from the author:
This was my first plugin, built for use on the survival server I run for a few friends. It's far from the robust village infrastructure I originally envisioned, mainly because I didn't want to completely rewrite all of the core minecraft village code and villager behavior... but I think it accomplishes enough. Since it reached a point that I'm fairly happy with several months ago, most of the time the only updates I do are to address major bugs or bukkit upgrades.
This was also my first foray into Java. As such, the code can be a bit of a mess in places. If you want to poke around to see how I did what I did, or fork it and add functionality (or fix bugs!) check out the git repository on GitHub. You might have to poke me extra hard with pull requests merging functionality back in unless I'm expecting them. And hey, if you've looked at the code and aren't completely turned off by it, a co-maintainer would be welcomed to the project. I'm sure some of my users would appreciate your contributions! ;)
- James
The Goal
To make NPC Villages (and the expansion and defense thereof) a more integral part of the game.
Installation and Documentation
https://github.com/jcornwellshiel/uvvillagers/wiki - Lots of details here, and it's almost up to date! Go go go!
Important note on bukkit versions:
This plugin hits core minecraft classes, and thus can be only run on the appropriate bukkit versions. You can't use UVVillagers for CB1.6.4 on a 1.7.2 server, or vice versa. Starting January 2014, if there is not a recommended build for the latest minor bukkit version (for example, at the time of this writing, 1.7 only has dev, alpha, and beta builds available) I will publish two copies of this plugin for each update I do:
- One for the current Recommended Build (Currently 1.6.4-R2.0)
- One for the most stable recent build (currently Beta 1.7.2-R0.2).
If you need more than this, feel free to contact me.
Basic Features
- Player popularity tracking with villages.
- Greeting displayed on entering villages.
- Receive daily tributes from villages that you maintain and defend, based on population and popularity.
- Extra-awesome zombie sieges.
- Rewards for defending villagers from zombie sieges.
Details
- Villages: Villages expand the core minecraft NPC Village functionality to include:
- Villages are named after the first player to discover them (after installing the plugin), and can be renamed by whomever is most popular with the village.
- Per-village-per-player reputation, broken down into configurable tiers.
- Information about physical size, population, etc is reported to users.
- Notifications are displayed upon entering a village, a village being abandoned, etc.
- Commands to get information about villages are accessible via /uvv
- Villages will pay nearby players a configurable daily tribute every day at dawn based on the players' reputation and the village's population.
- Sieges: Zombie Sieges expand on the core minecraft Zombie Siege functionality, and are strongly enhanced and configurable.
- Any mob can potentially spawn. Yes, including withers and ender dragons.
- Siege statistics are tracked, and killing mobs that are part of a siege grants reputation with the village under siege.
Currently working: (version 1.3.8)
- Citizens support
- Configuration files! (All values and % chances can be changed!)
- Configurable messages!
- Village population and reputation announced upon nearing a village.
- Zombie Sieges can spawn all sorts of crazy stuff.
- Override core Zombie Siege mechanic in favor of ours.
- Spawn a siege on-demand.
- Village-Player reputation tracking
- Villager tributes! (Player receiving tribute must be near the village at exactly dawn)
- 0-3 emerald tribute per 20 villagers in nearby villages every day at dawn.
- 1 emerald tribute bonus per 20 villagers.
- 1-2 emerald tribute bonus per zombie siege kill during the previous night.
- multiplier based on current reputation
- Dynmap support is now integrated
- Multiworld support
- Some prevention of typical zombie siege avoidance tactics (like using floating platforms) by spreading spawns out over a radius.
- Can now select items other than emeralds for tribute!
- Collecting tribute from a mayor instead of it magically appearing (requires CB 1.5.1)
- Set whether tribute is collected from the Mayor or appears directly in your inventory
- Configurable minimum village size
- Preventing villager purchases if your reputation is too low
- Iron Golem aggro on extremely low reputation
- Overriding core popularity effects (cancel iron golem attack if it's caused by your reputation being too low)
- Chest tribute
- Better mayor retention
- Server-owned villages with /uvv setserver
Known Bugs
- Null exception thrown for some people using dynmap (properly caught since 1.2.5, still not sure of root cause... for some people dynmap is returning null when creating new markers, even though the marker is created)
- Mayors sometimes teleport into occupied blocks, suffocating them. This might be addressed now.
Enjoy! Post your bugs, exploitable aspects, and suggestions in comments here or at the GitHub repo !
@jcornwellshiel
Its working fantastic. I will test is alongside the plugins I removed to see if is all good.... I need Jimmy and Xan back as otherwise I have to do all the killing work ! Will give update as soon as I am able.
Bubblybill and villagers have prepared a tribute for you...
5 Sticks for your awesomeness
(We are a very poor village, but its everything we have)
Just posted 1.2.1 - major bugfix in potion buffs. Hooray. Now I can finish that beer I'd started...
Not sure how long it'll take them to approve it, so here's a linky.
@bubblybill
I've isolated the issue. Fixing and testing now.
Side note... I think I posted the wrong version somehow. ...I've been really bad at deployment this week.
@bubblybill
Probably not you. I'm looking into it now.
Sorry, I think I broke it. http://pastebin.com/sge2bbyq
I tried to fix by removing plugins that may cause errors
Citizens, Denizen, Builder, Senty etc
Still got this error when I forced a siege with (/uvv startsiege)
I have no idea what has gone wrong, If you can tell from the errorlog and can stop laughing over my possible stupidity of something ive done.. please let me know....In a gentle fashion of course as im still emotional after having removed my Sentry guards Jimmy and Xan which have been with village for at least week.
@CorvusPVP
Are you using version 1.2.0? If so, did you change potionMinPower or potionMaxPower from their defaults of 1 and 2?
Each level of the damage resistance potion effect reduces all damage taken by 20%. In version 1.1.13 I mistakenly allowed them to get up to level 5 power, which made them invincible for the duration of the potion. That should be impossible in 1.2.0 unless you bumped the potionMaxPower setting up to 5 or higher.
perhaps i've done something wrong but zombies with potion effects refuse to die....
@bubblybill
I've contemplated that many a time to reduce all that damned door squeaking and slamming. I don't think Social Services would blame you.
I posted 1.2.0 a few minutes ago. Huzzah! Just waiting for approval now.
@jcornwellshiel
Looking forward to the potion update. I don't mind waiting a while as its better than scratching my head trying to get potentially broken things working.
Thanks for responding to my ideas, I don't know how minecrafts core bits work as im not that clever and I appreciate you spending the time to explain what is possible and whats not.
P.s I managed to sort out my villagers opening and closing doors constantly which was driving me mad.......... Ive glued them all in minecarts !!! Easy to transport and select your trade. Just please don't make a Social Services plugin or I will be in prison for Villager abuse !
Didn't have enough time tonight to run tests, so rather than upload a potentially broken version, you get to wait for tomorrow.
That said, in the new version potion buffs are configured per mob per potion. (Yay!) and you'll be able to change announcement text much more easily and cleanly.
You'll want to backup and delete your siege.yml and language.yml to pull the new config options in.
@BroDanCha
Should be fixed tonight with the potion buff fixes. Some dumb dev hardcoded that stuff. ^_^
Tell us again how to make the zombie sieges visible... Thanks, this plugin has some depth to it. I like it.
Sorry I've been so quiet the last week or so - life got real busy. Let me know if you're interested in joining on as a co-maintainer. I could certainly use assistance when life load gets high.
Should have a new release with potion configuration and better custom string handling tonight.
@bubblybill
I could override Minecraft's village detection, but right now that's not on my radar... mostly because Minecraft's villages doesn't detect "buildings", it detects "valid doors". Associating doors with beds would be possible, but it leads into a whole bunch of other things (How many doors should one bed be allowed to validate? Should I path all my villagers back to "their" bed at night? Additionally, villagers tend to congregate in central areas of villages, causing doors to be "forgotten" (no longer be part of the village until a villager paths bath to them accidentally). There's just too much chaos in village doors and such in core to really eff with under my current time restraints.
It would also require adding beds to core-generated villages for consistency, which... bleh :P
The main difficulty is that I'm trying to avoid overriding too much of Minecraft's core functionality. Maybe I should just get over that and start breaking stuff though. ;)
@BroDanCha
Thanks!
Right now war (and villager attacks, etc) are outside of the scope of this particular plugin. That said, core minecraft maintains a player popularity variable for each village, ranging from -30 to 10. Iron Golems attack players by default if their popularity is below -15. UVVillagers sets this popularity directly to -30 or to 10 based on the "hostile" flag for the player's UVVillagers reputation rank in order to make a village's Iron Golems attack low-reputation players (which means that other plugins can use the same popularity variable to manipulate other village responses).
I guess technically right now defensive PvP is possible, at least with Iron Golems. No raiding parties, of course...
I've been playing around with your plugin and it is fun. I suggested it to my friends so we play together.
Perhaps I missed it, but have you thought about creating warrior villagers or awarding high reputations with warriors or slave zombies/villagers (like wolves) who could act as raiders of other villages, particularly my friends' villages? The higher your reputation in your village(s) the more warriors you get and you can go to war with other village defenders - and take over other villages. This pvpish add may not be your thing and that is fine.
Keep up the nice work, bro
After thinking.. about village designs. Is is possible to limit villagers so you need a bed for each one ?
At the moment our village house is just a maze of doors(maximizing the villager spawn rate). This makes the building unrealistic. If a "need a bed per villager" option was added the building would need a bedrooms thus making the villages seem more normal.
Just a thought any how.
@jcornwellshiel
No problem, We all still love you !
Sorry guys, no time to update tonight. Will try to get on it tomorrow.
@Psycho089
It's every 20 minutes, but yes, I'll be adding that in with an update tonight.
To remove the midnight siege, in siege.yml set useCoreSiegeEvent to false and nonCoreSiegeChance to 0.
@bubblybill
I've fixed a bunch of stuff with the potion buffs, and will be adding more fine-grained configuration for it in tonight's update. I didn't test potion buffs enough before uploading... it really imbalanced the sieges.