spawns
Spawns is a plugin for Bukkit and Minecraft that allows you to fully customize the spawning behaviour of mobs on your server.
Features
- tweak the default Minecraft spawns or replace them completely
- set mobs to spawn under conditions they never normally would
- block certain mobs from ever spawning
- cause mobs to spawn with potion effects, equipment, saddles, etc.
- cause mobs to spawn in different variants, like powered creeper, wither skeleton, etc.
- mobs appear in the world in the same way as they do normally, so are compatible with all other plugins
Dive right in here to see how to make config files or keep reading for an overview of Minecraft spawning.
Default spawning
Minecraft spawning works like this:
Every spawn cycle (1 tick or 1/20 second by default for hostile mobs) the game makes a list of all the chunks around each player, up to a radius of seven chunks. Each chunk will only be counted once, even if that chunk is around several players.
Once this list is complete a mob limit is calculated. The limit is higher the more chunks are in the list. If the limit is lower than the current amount of a mob type in the world then the cycle will be cancelled.
If the limit is not yet reached a random block from each chunk in the list will be calculated and this chunk will be used as the centre point for a pack of mobs to spawn around. In order to continue, this block must be water for water mobs (only squid so far) and air for any other type of mob.
If this block is suitable then a maximum of 12 random blocks are chosen from up to 20 blocks away, but always at the same height as the centre block.
Lastly, The individual blocks are checked that they can physically fit the mob, so they need to be air, have air above and an opaque block below. The type of mob is chosen based upon the matching conditions (biome, height, floor block type, etc.) and the final mob is chosen randomly from all mobs that are eligible to spawn there. All other mobs in the pack will be the same type.
Permissions
spawns.can-reload-config, which allows the user to reload the config. Default is Op.
spawns.can-count-mobs, which allows the user to display a summary of mob amounts in a world. Default is Op.
Commands
/reload-spawns, or /rs, which reloads the config without having to reload the server. Any mobs already in the world will be unaffected by any changes in the config.
/count-mobs, or /cm, which displays a list of mob numbers in the world. Add a world name argument to specify a world (optional if run as a player) and / or a mob type argument to choose one type of mob to count.
Update checking
If you like, you can set the plugin to check for any newer versions that get released. To do this add an element to the config.xml file, like this:
<check-for-newer-version/>
When this element is present the plugin will report if it finds a newer version. This only works for release builds so you won't be bothered by any beta or dev builds. To disable this checking simply remove the element.
Note that no update will be downloaded even with this set.
Examples
I would love to get any example config/packs/mobs files you have created to add to the docs, so if you have one you're proud of send it in and I'll add it.
spawns took a lot of work, so if your server is enriched by it please consider sending some love my way!
<a href="https://www.paypal.com/cgi-bin/webscr?return=http://dev.bukkit.org/server-mods/mobs/&cn=Add special instructions to the addon author(s)&[email protected]&bn=PP-DonationsBF:btndonateCCLG.gif%3ANonHosted&cancelreturn=http%3A%2F%2Fdev.bukkit.org%2Fserver-mods%2Fmobs%2F&lc=US&itemname=spawns+%28from+Bukkit.org%29&cmd=donations&rm=1&noshipping=1¤cycode=USD"><img class="aligncenter" alt="donate" src="https://www.paypalobjects.com/enUS/i/btn/btndonateLG.gif" /></a>
If you're penniless or like spawns but not that much I'm also partial to TF2 items. Send any you don't want my way! STEAM id: coldntired
If you don't know what TF2 is, then start playing! It's free and fun!
For other projects, links, help, etc. please visit the main website.
You can also follow sylian.eu on Twitter for updates.
I also, only got a config.xml Thank you for posting the others! But, is it posible to have an example on how to create a custom mob I've read most of the information but to be honest, i'm not sure how to start x.x
<<reply 1664217="">>
You can do it but it's very hacky. The workaround I put in Mobs was simply to fire something/damage a player when it got too close. It doesn't chase the player though.
b4 - http://dev.bukkit.org/bukkit-plugins/spawns/files/4-1-6-2-b4/
Possibly fixed the async problem from yesterday.
Made it so that the pack centre is chosen the same way MC does it (random x and z, and random y up to 15 blocks above the highest non-air block). Before it always used the player's y value.
Made it so that the packs and mobs files are created before the world check (which will always fail the first time by design).
Lastly, added a new mob property called riding. This is to set a mob under the spawning mob. Any combination is permitted but not all work properly. I personally like skeletons riding on slimes, myself.
<mob>
<riding>cow, slime</riding>
</mob>
@coldandtired
Would you even be able to make them hostile and do damage?
<<reply 1663727="">>
I've added this now but as SXRWahrheit said, the horse will still act like a normal horse. When everything's working as expected I might see how easy it is to make horses chase players though.
<<reply 1663136="">>
Fixed pretty much all that. The horse value wasn't getting read by the plugin. You shouldn't need to convert TC biomes as the plugin should recognize them. I'll post full update stuff in a second.
You can easily reduce the spawns by either setting the count conditions lower, the pack size lower, or making the pack and/or mob have stricter conditions.
@Hangar
You probably have your Bukkit.yml spawn counts too high. Did you know you can reduce the spawn ratios there?
@Hangar
I don't know if that mounting would work properly, but the skeleton horse wouldn't have the appropriate AI to chase after you or be aggressive. You would need another plugin to manage that as well.
This looks like an excellent plugin! I will definitely give it a go. One suggestion, or rather a question; could this plugin later down the road of development grant the user the ability to spawn mobs riding other mobs? Like for instance setting skeleton-horses to spawn at night with a skeleton mounted on top? It would be ever so useful for creating even more interesting and unique mob-spawns. The question would be whether this is even possible or not.
@SXRWahrheit
I didn't get the packs and mobs files generated until I filled in the proper world name in the config file and restarted the server. I think that's what's going on there.
I'm trying to use this plugin with TerrainControl and I'm not sure if that presents any special issues. I do use their 'ReplaceToBiomeName' on all my custom biomes to 'convert' them to a vanilla biome type right after generation but I'm not sure this plugin is seeing all of my custom plains as actual plains. I can't find any horses at all, even in the 'un-replaced' plains biome. I'm also seeing times where no monsters will spawn if I'm simply hovering in the air a bit but once I land, they start spawning like crazy.
My overall goal is to replace vanilla animal spawning (or whatever is going on with TerrainControl) with a reduced amount of animals. They seem to be way too available in some areas. Monster spawns... I just need to stop some of the slimes from spawning in my deep canyons but otherwise it's mostly ok.
Let me know when you have that sync bug fixed and I'll try the new build.
@coldandtired
Not that I checked but later on I will. :)
<<reply 1662502="">>
Oddity, oddity! Any errors in the log?
Here is the packs file - http://dev.bukkit.org/paste/8220/
And here the mobs file - http://dev.bukkit.org/paste/8221/
I only got a config.xml when I ran the plugin, FYI.
<<reply 1662411="">>
It should be pack-radius, so the auto-generated packs file is wrong. Nicely spotted, I've updated it for future versions.
Your config should be okay. Each condition group gets a chance to cause the action to happen, so if it fails the first one (i.e. there are more than 280 animals), it will try the next one and so on until one group succeeds or there are no more groups to check.
I'll add some more examples tomorrow.
<<reply 1661838="">>
Looks like something is async when it should be sync. I think I know what it is.
You have 'pack-range' in the packs config but 'pack-radius' on the doc page... I think.
Also, I'd like to see maybe a few completed examples. Here's how to stop all mob spawns... then here's how you add back 1 animal and 1 mob type... and then how you limit them in a few ways. Slogging through .xml specs is brutal (sorry) :/
Is it possible to have the cycle start if either the animals falls below one number -or- the monsters falls below a different number? I'm trying to disable the generation spawn atm to just focus on re-spawns but I'm not sure if I did that right either :p
http://pastebin.com/ZCfRzyk6
I think this version broke something.
http://pastie.org/8174892
http://pastie.org/8174893
<<reply 1661722="">>
/rs displays a confirmation for me. Can you try with /reload-spawns?
You should never really reload the server or reload a plugin, they're not really designed for it and you get errors and memory leaks happening.
Connected to that though I have just seen that the /rs command wasn't hooked up to anything so I fixed that - http://dev.bukkit.org/bukkit-plugins/spawns/files/3-1-6-2-b3/
Manually reloaded with PluginManager and this happened:
2013-07-25 15:51:29 [SEVERE] Error occurred while enabling spawns v1.6.2 b2 (Is it up to date?)
java.lang.IllegalAccessError tried to access method eu.sylian.spawns.WorldHandler.<init>(Lorg/bukkit/World;Lorg/w3c/dom/Element;Leu/sylian/spawns/Spawns;)V from class eu.sylian.spawns.Spawns
at eu.sylian.spawns.Spawns.loadConfig(Spawns.java:108)
at eu.sylian.spawns.Spawns.reloadFiles(Spawns.java:54)
at eu.sylian.spawns.Spawns.onEnable(Spawns.java:46)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
at net.skycraftmc.PluginManager.PluginManagerPlugin.onCommand(PluginManagerPlugin.java:287)
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.dispatchCommand(CraftServer.java:523)
at net.minecraft.server.v1_6_R2.PlayerConnection.handleCommand(PlayerConnection.java:964)
at net.minecraft.server.v1_6_R2.PlayerConnection.chat(PlayerConnection.java:882)
at net.minecraft.server.v1_6_R2.PlayerConnection.a(PlayerConnection.java:839)
at net.minecraft.server.v1_6_R2.Packet3Chat.handle(SourceFile:49)
at net.minecraft.server.v1_6_R2.NetworkManager.b(NetworkManager.java:296)
at net.minecraft.server.v1_6_R2.PlayerConnection.e(PlayerConnection.java:118)
at net.minecraft.server.v1_6_R2.ServerConnection.b(SourceFile:37)
at net.minecraft.server.v1_6_R2.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:590)
at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:226)
at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:486)
at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:419)
at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
Can you throw a confirmation message on /rs?