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.
Keep it cool, please guys!
I don't follow Minecraft development and mainly play it on the PS4 with my sons so please let me know of any updates or relevant features on the PC here.
@zachrywilsn
Must you demand updates EVERY time...
(yes yes you're "just mentioning it in case he didn't know" right...)
Give the guy a break, he'll update when he has time.
1.11 is up for grabs now, just a heads up.
@coldandtired
Cool! This will give more control over the item drops too, very handy.
Remember to add it to the wiki! :)
10.2 b2 is up.
@Schlutteh Cheers. I've changed the ones I could find to point to the new docs.
@coldandtired
Just wanted to let you know that the Spawns doc's link to the old material list: https://jd.bukkit.org/dev/apidocs/org/bukkit/Material.html (now 404'd)
@coldandtired
Thanks for adding the requested features to spawns. Ill be sure to make something available for you all but Im still not done with my own idea yet.
3D Preview of the Model: https://skfb.ly/VNLP
@Schlutteh According to the docs it takes a material but I only tested it with blocks. Possibly other items would just float between the hands.
@coldandtired
Hey that's pretty cool, gonna try these out. Is <carrying> limited to full blocks, all blocks, or all items?
10.2 b1 is up.
@Comp52
You are welcome to try these out: http://bit.ly/spawns_examples I can not guarantee they will work for you with out adding or adjusting, but believe they are fairly simple to read. (there maybe un-needed conditions etc but Im also still learning.)
@coldandtired: Is there an example config setup that I can use to model after? I know I don't have my own configs set up properly because vanilla mob spawning is still occurring instead of the custom spawning. It would be very useful, since there is no guided tutorial on the wiki, to have an example setup for each file(world.xml, mobs.xml, packs.xml, etc.) so that new users would have a baseline for how to set up their own configs. It's very confusing to try and learn the plugin without having something to model after, and the wiki isn't always very useful in that regard.
I have a bit of time from tomorrow afternoon so I'll be going through the code and the comments/PMs to see what needs to be added/updated (and doing it! :) ).
Both of you (you know who you are): Just leave one another alone. I've deleted the comments. Don't make me take it further.
Any chance someone has a Close to Default Spawning Spawns config/world/mobs/xml? Would be amazing if it was posted here and linked to the documentation.
@coldandtired,
I'd like to use this plugin with the MyZ plugins to give custom spawned mobs custom AI as well. Would that plugins break yours or vice versa? Is it possible to use the two together or will onenjoy break the other due to the way mob spawning is handled?
@Schlutteh
Thanks Schlutteh. Yes I'd worked out I needed the ellipsis but this was an example to show the value for having a debug warning message for incorrect plugin syntax. In either case, the config file appears to correctly load but using 'to' isn't recognised by the plugin and the remainder of the parsing fails.
Try this: change '..' to 'to' somewhere near the start of your mobs.xml file and issue the 'rs' command. You should see the is no apparent issue, but if the server is restarted, the debug_log.txt doesn't parse the revision.
Incidentally, the debug_log.txt file only appears to be rewritten on server restart, and isn't updated when issuing the 'rs' command to reload the spawns config. So it's a very long debug cycle to try and determine where syntax errors lie.
Having said all this, any perceived criticism should be balanced by noting my motivation to get it going; this is such a powerful and versatile plugin that I will continue to use it even if I can't quite get my configs set up correctly. None of the other plugins come close to what you can do with this!
@Meswrex
I'm not sure if it will help, but I've been using <light>0..8</light> for 0 to 8, and <light>8..</light> for over 8 etc.
@coldandtired
Indeed. Yes a good choice. I do like XML for that reason. I probably should have clarified though that what I meant was not so much syntax errors, but moreso unrecognised parsed elements. I think I have sometimes used deprecated plugin syntax by using very old examples and only later saw this had changed. I don't get a warning or error message to say the parsing has failed (only if there's an error like the ones you describe of missing closing tags etc - then there's an explicit 'problem loading config file' message in-game). E.g. if you look at the mobs file example here http://spawns.sylian.eu/examples/ you'll see a deprecated range syntax "<light>0 to 8</light>" whereas the current syntax uses ":" instead of "to". My recollection is that no error or warning is thrown here and it took me a while to chase down the problem. My current file has broken elements (some mobs missing even though I got each set working individually) and some debug warning/error messages would be very handy. A lot of work at your end I suspect tho :/ user requests can sometimes appear simple, but can easily mean significant work for the developer to effect.