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 you update this to 1.7.5? My players need this!
@aussie1579
Most likely the reason you're not seeing a ton of mobs is that the current spawning calculation is a random number from 1 to (village.population / mob.threshold), capped at mob.max. If your threshold is 20 for a mob, and you have 40 villagers, you're only going to get 1-2 of that mob type.
I can add a min setting, and change the calculation to mob.min + random (1 to (village.population / mob.threshold))... or I can just totally redo the calculations. I'm leaning toward the latter, but it'll have to wait 'til next week.
Would it be possible to add a "min" to the siege config, even with large towns I find that the amount of mobs is really not that many
Uploaded a permissions bugfix. The /uvv rename command will now properly use the uvv.rename permission.
@aussie1579
Roger that. Will address it tomorrow when I'm back at the computer.
@jcornwellshiel
Noticed a slight issue, uvv.rename does not allow people to rename villagers, only uvv.admin permission node allows it
@Fillbach
Well, I just updated the description to make note of it because of your post. :)
@jcornwellshiel
Thanks! I'm not really sure how i missed that
@oolliiee123
Glad to hear it!
@jcornwellshiel
Alright, I'll have to look into it more on my end. It just surprised me considering I had the mayor "trapped" in a building.
@der_Kernschatten
Something's got the chunk loaded, as entity events don't occur when chunks aren't loaded.
If I remember correctly, some chunks near spawn always stay loaded... and plugins like Citizens which create player-style NPCs end up keeping chunks loaded around the NPCs due to the way they're created.
[17:00:03] [Server thread/INFO]: The Mayor of Ur has died by EntityDamageEvent![m
Can you tell me how this could happen when no one is on the server and as such the chunk shouldn't (in theory) be loaded?
@Fillbach
http://dev.bukkit.org/bukkit-plugins/uvvillagers/files/29-uvvillagers-1-3-8-for-cb-1-6-4/
Please note that this file is under review by bukkit staff. It will be made available in the Recent Files pane when they have cleared it.
As your issue is pretty critical for you, I'm linking it here. Just be aware that they haven't completed their standard security review of it yet.
@Fillbach
You're getting those errors because you're using the wrong version of UVVillagers. Unfortunately, because Bukkit doesn't have classes for villages, this plugin has to hit core Minecraft classes. Because of the way Bukkit devs handle versioning, that means that each version of UVVillagers has to be built for a specific version of Bukkit. I should note that I agree with that choice (it prevents some very nasty potential consequences when parts of Minecraft's core classes change), but it does cause headaches.
What that means for you is that you can't use a version of UVVillagers that says it's "for CB 1.7.2" on a 1.6.4 server. At all. Period.
I'll push out a 1.6.4-compatible build with the latest features tonight. Meanwhile you can use http://dev.bukkit.org/bukkit-plugins/uvvillagers/files/24-uvvillagers-for-1-6-4-r2-0/
Hey, a couple of quiestions
Running craftbukkit 1.6.4
1) It seems to never load any villages. I have no villages over pop. 20. So it never allow me to actually do anything. How can i fix this? Did i miss soemthing?
2) I get this error over and over. Just about anytime anyone does any sort of action
2014-01-12 13:17:19 [SEVERE] Could not pass event UVTimeEvent to UVVillagers v1.3.8 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at net.uvnode.uvvillagers.UVVillagers$1.run(UVVillagers.java:267) at org.bukkit.craftbukkit.v1_6_R3.scheduler.CraftTask.run(CraftTask.java:53) at org.bukkit.craftbukkit.v1_6_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) at net.minecraft.server.v1_6_R3.MinecraftServer.t(MinecraftServer.java:524) at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:227) at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:488) at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:421) at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583) Caused by: java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_7_R1/CraftWorld at net.uvnode.uvvillagers.VillageManager.getClosestCoreVillageToLocation(VillageManager.java:51) at net.uvnode.uvvillagers.VillageManager.updatePlayerProximity(VillageManager.java:546) at net.uvnode.uvvillagers.VillageManager.checkPlayerProximities(VillageManager.java:533) at net.uvnode.uvvillagers.UVVillagers.onUVTimeEvent(UVVillagers.java:813) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) ... 11 more Caused by: java.lang.ClassNotFoundException: org.bukkit.craftbukkit.v1_7_R1.CraftWorld at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:70) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 19 more 2014-01-12 13:17:29 [SEVERE] Could not pass event UVTimeEvent to UVVillagers v1.3.8 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at net.uvnode.uvvillagers.UVVillagers$1.run(UVVillagers.java:267) at org.bukkit.craftbukkit.v1_6_R3.scheduler.CraftTask.run(CraftTask.java:53) at org.bukkit.craftbukkit.v1_6_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) at net.minecraft.server.v1_6_R3.MinecraftServer.t(MinecraftServer.java:524) at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:227) at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:488) at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:421) at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583) Caused by: java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_7_R1/CraftWorld at net.uvnode.uvvillagers.VillageManager.getClosestCoreVillageToLocation(VillageManager.java:51) at net.uvnode.uvvillagers.VillageManager.updatePlayerProximity(VillageManager.java:546) at net.uvnode.uvvillagers.VillageManager.checkPlayerProximities(VillageManager.java:533) at net.uvnode.uvvillagers.UVVillagers.onUVTimeEvent(UVVillagers.java:813) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) ... 11 more 2014-01-12 13:17:39 [SEVERE] Could not pass event UVTimeEvent to UVVillagers v1.3.8 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at net.uvnode.uvvillagers.UVVillagers$1.run(UVVillagers.java:267) at org.bukkit.craftbukkit.v1_6_R3.scheduler.CraftTask.run(CraftTask.java:53) at org.bukkit.craftbukkit.v1_6_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) at net.minecraft.server.v1_6_R3.MinecraftServer.t(MinecraftServer.java:524) at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:227) at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:488) at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:421) at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583) Caused by: java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_7_R1/CraftWorld at net.uvnode.uvvillagers.VillageManager.getClosestCoreVillageToLocation(VillageManager.java:51) at net.uvnode.uvvillagers.VillageManager.updatePlayerProximity(VillageManager.java:546) at net.uvnode.uvvillagers.VillageManager.checkPlayerProximities(VillageManager.java:533) at net.uvnode.uvvillagers.UVVillagers.onUVTimeEvent(UVVillagers.java:813) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
@aussie1579
I'll have to see how expensive looping through the player list and sending individual messages is, vs the server broadcastMessage call I'm using now for general messages, but it should be doable with a little prep work.
A good suggestion would be to suppress messages if the user does not want to see them every MC day, Had multiple complaints of chat became "spammy"
@jcornwellshiel
Just finished 1.3.8, which adds the requested startsiege functionality, as well as splitting out the permission into uvv.startsiege instead of being lumped into uvv.admin.
The new syntax for /uvv startsiege...
/uvv startsiege - Start a siege in a random village in each valid world.
/uvv startsiege <world> - Start a siege in a random village in the specified world.
/uvv startsiege <world> <village name> - Start a siege in the specified village in the specified world.
@canibecooltoo
Depends on how they're set up, I suppose. What mods, specifically?