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 !
can this spawn mobs from mods ?
@chirochord
I suppose I could do that pretty easily after the holiday. Currently sieges will only start if the village is loaded and a player is near enough to it, but I can envision situations where that might not be sufficient.
Would you / could you make it so that we can start a siege in a specific village as well as a random? Sometimes the larger villages would like to have a siege but not at the risk of damaging a little village just starting out... just a thot!
~ Knuffle Bunny
@LHammonds
Great! I should write some decent documentation at some point, I suppose...
@jcornwellshiel
Awesome! That did the trick. Thanks.
@jcornwellshiel
Actually, as it turns out, I already did make it customizable. The language.yml string is village_default_name. Just remove the coordinates.
@LHammonds
The initial village naming isn't customizable, but I'll see about fixing that. The coordinates are broadcast as part of the default village name (Village @ X,Y,Z).
Most lines are customizable in language.yml (see default config here: https://github.com/jcornwellshiel/uvvillagers/blob/master/src/main/resources/language.yml). You can remove the "@village" token from siege_began as a temporary fix.
My players found a big issue with the plugin. When a siege happens, it broadcasts the coordinates of the village to the entire server, making it easy for anyone to find and kill all the villagers. Please remove the coordinates from the message or at least give us an option to customize the line that is broadcast to the server.
Thanks,
LHammonds
@LHammonds
For me, the confusion stemmed from the log lines referencing a craftbukkit 1.6.4 build, which I can only assume are due to some oversight by the bukkit devs themselves.
In any case, the error was a line that I accidentally put outside of some null-check logic, which would only affect towns missing either a mayor or a sign (or both)... a scenario that didn't occur on my server during testing.
Hopefully that's the only error... no others have come up on my server yet.
@jcornwellshiel
Thanks for figuring it out so quickly. :)
Is there a way sieges can be disabled for specific villages? The reason I ask is that some people like to spend a ton of resources trading with specific villagers in order to get a lot of trade options but I've seen the Herobrine army materialize inside of huts that were protected (blocked doors and well-lit) and kill villagers who otherwise would have been thought to be very safe. Or is the solution to move important villagers far away from where the mayor's teleport home is located? I assume that is the key location where the enemy will appear.
@Bannta
I've run CraftBukkit and vanilla servers for over 2 years. I know what I'm talking about AND I provided the evidence to back it up. I don't run Spigot servers but even I know "spigot" is injected into the build name (which you did not see in my posts).
Found it. I did something stupid, as expected. New version uploading shortly.
It's waiting to be scanned and approved by the bukkitdev staff.
@Bannta
No, he's right. My server is also running craftbukkit 1.7.2 and it has that same 1.6.4 message in startup.
Looking into the errors on movement in about 30 minutes.
I am seeing errors when the mayor moves around, other than that it seems to be working fine
@LHammonds
no your not, your prolly running the version that make it so peeps who loaded 1.7.2 clients can launch on a 1.6.4 server seamlessly. I know spigot release a 1.7.2 pseudo server before bukkit even started working on a pure 1.7.2 bukkit.
should look like this: (note: i run spigot on my server) [15:50:59] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-1177 (MC: 1.7.2) (Implementing API version 1.7.2-R0.1-SNAPSHOT)
@jcornwellshiel
100% positive I'm on 1.7.2-R0.1 Build 2954
@LHammonds
Hrm. Haven't encountered that on my end, and it's one that if it's going to throw an exception, should throw it every few 10 seconds (as you saw).
You're sure you're on 1.7.2? (if you weren't there'd be a whole lot more than just that error I would think, but the "craftbukkit.jar:git-Bukkit-1.6.4-R2.0-39-g68b702f-b2954jnks" is throwing me.)
I'll make sure my build matches and test it this afternoon.
I'm trying out 1.3.6 but receiving a lot of console errors such as the following:
To get an idea of how often these errors are occurring, I'll copy the 1st lines for a consecutive block of errors:
Environment
OS: Ubuntu Server 12.04.3 LTS, 64-bit
Java: Oracle Java 1.7.0_45, 64-bit
CraftBukkit: 1.7.2-R0.1 Build 2954
Plugins: PermissionsEx 1.20.4, UVVillagers 1.3.6
@LHammonds
I'm going to rewrite the pathing for mayors properly when I get the chance. In the meantime, I've uploaded 1.3.6, a patch that only teleports if it finds a safe spot within a certain radius of the sign. Hopefully that works better.
@LHammonds
Thanks LHammonds. Looks like I might need to rewrite some of the mayor movement code...
As for the dynmap error... I assume that's showing during server startup? It should probably be reclassified as info (or just silenced).
If I get time I'll poke this stuff when I get home tonight.
Thanks for creating and sharing this plugin. I am evaluating it for use on my server.
UVVillagers 1.3.5 works for the most part on CraftBukkit 1.7.2-R0.1 (any build) with Java 1.7.0_45 (64-bit).
I think I have found a bug though. My mayors kept dying off and upon further observation, I saw them teleporting into the itemframe / wall it is hanging on and suffocating to death.
I tried various materials and positioning but nothing seemed to matter if the blocks remained even after breaking the item frame. To get around this, I build a small dirt tower inside a home, place the itemframe and emerald to create the mayor, then I remove the itemframe and dirt tower. When the mayor teleports to that location, he does not suffocate because nothing but air is there now.
I also noticed this in the server log:
I don't use DynMap nor have it installed. Why would this be classified as an "ERROR" and how can I prevent it from even showing up in the log since it is not something I should even worry about since I don't have DynMap?
Thanks,
LHammonds