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 have a 68 hour work week this week and next... if things quiet down I really do want to do some testing with this. :)
Do you know if anyone has done a raw numbers writeup on damage input and output of mobs and players equipped with different items? IE each type of sword versus full armor kits. I want to be able to balance this properly.
<<reply 1657665="">>
It depends how much control you want. Mobs was designed to allow dynamic mobs, for example controlling what item drops depending on who killed it or what the player was holding at the time. It can also block most events from happening (including spawning). The important thing is that Mobs is reactionary, in that it takes what Minecraft/other plugins are doing with mobs and alters some things.
Spawns deals only with what can spawn and when. Unlike Mobs Spawns actively controls spawning, either by limiting default spawns, or adding extra ones on top. It also allows a few things like potions and equipment to be set on the spawning mobs.
Anecdotal evidence suggests that most admins wanted Mobs to control mainly spawning, and so I created Spawns to handle that.
Any help in testing is appreciated. I feel the code is pretty complete but it's hard for me to test real conditions with multiple players interacting with the world,
I'm willing to help test this currently if you need it. My TC world is about done and I'm trying to investigate mob spawning plugins. I was watching Mobs for a while but maybe this is better for general control/limiting?
<<reply 1644372="">>
I optimized the code a lot so it should run fine on most servers now. There might still be a couple of small bugs but it's more or less done.
http://dev.bukkit.org/bukkit-plugins/spawns/files/2-1-6-2-b2/
@coldandtired
I'm not blaming spawns, I'm blaming Bukkit mostly - we were fine on 1.5.2 but since the update things have been dicey. I haven't had time to sit down and properly test which plugins are causing the issue or whether it's bukkit itself as I've been working 60+ hours a week... bleh.
I'll give spawns a go either sometime today or on Friday.
<<reply 1644252="">>
I see a few places where the code can be optimized but I thought I'd put it out there before I start delving into caching and multi threading too deeply.
There have only been about 7 or 8 Craftbukkit builds releases since I started this so I haven't been able to see if the performance is improving or not.
@coldandtired
I'll test it on my local machine - i7 3690x and 32GB of RAM. I'm hesitant to throw it on my server straight away because the 1.6.2 builds of bukkit already have tickrate under 20 in general.
I've released the first beta version here.
This puts an unnacceptable lag on my local server but before I start trying to optimize it I would like to see if proper servers handle it better.
What you're looking for is mobs moving jerkily at whatever you've set the cycvle-interval too. This is of course when the majority of code in the plugin runs and this is what blocks the main thread causing mobs to pause in their movements.
Apart from that though it's almost fully functional - the only thing missing is adding the code that stops big mobs spawning in small spaces and refining the spawing conditions.
Makes sense to me - I like the direction you've taken with this and Mobs. Makes it easier to write out the file yourself. Well done.
The documentation is pretty much complete so hopefully this can be released very soon. Have a read and let me know if anything isn't clear.
YESSSSSSSS.