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.
Very minor bug:
Spawning baby sheep with the <lock-age/> element, they will still grow into adult sheep. I think it has something to do with their (feeding on grass to re-grow wool) update behaviour.
Anyhow, I doubt anyone really needs permanently baby sheep all that badly, I know I don't, just thought I would point it out.
All other animals seem to stay locked as babies with <lock-age/> added, makes nice pets.
@SXRWahrheit
Ha! I wish.... Sadly they just walk about randomly. Sometimes they look at me and wag their tail-stubs, I just can't kill them then!
I wish the riders would stay on them, but somehow they get off the horse pretty fast.
Still, a fun addition.
Try my pirates:
<enderman>
<id>pirate</id>
<pack-limit>4</pack-limit>
<riding>boat</riding>
<name>Monkey-D-Luffy, BLACK-beard, YARRRR</name>
<spawn-if>
<biome>ocean, river</biome>
<block-light>0</block-light>
<blocks-from-player>above 23</blocks-from-player>
<blocks-from-spawn>above 23</blocks-from-spawn>
<success-rate>5</success-rate>
</spawn-if>
</enderman>
@Schlutteh
Do the horses actually give chase? Having skeletons on undead horses is great and all but fairly worthless if the horses don't pursue. ;)
Would be awesome if they would flank you rather than just charge too.
Flawless victory.
Well asides from my undead cavalry sometimes dismount from their undead horses, it's still pretty freakin' cool.
Also I made pirates, using the new ability to ride boats:
http://i.imgur.com/MaJKimi.jpg (sorry don't know how to embed link)
Hilarity ensued.
1.6.2 b9 is done.
The uploader here seems to be broken so you can find it on the main website.
@Schlutteh
Deprecated means intact but planned to be removed. You should be fine.
Well that sounds like a grind, at best, or at least headache material right there...
I look forward to the day that Minecraft (official) dev is finished, so that all the multiple tiers of mods can finally settle the code and concentrate on the fun stuff.
So just to clarify... I am safe to use this build (b8) with Bukkit 1.6.2-R1.0...?
Also, funny thing, I did manage to spawn angry wolves.... but they don't know who they're angry at!
<<reply 1781364="">>
No worries :) Real life very often gets in the way but things generally move in the right direction.
Between the last Bukkit Beta and the RB they deprecated all uses of item ids, skeleton type ids, colour ids, etc. with the rather unhelpful reason of 'magic number'.
Deprecation is used in APIs to inform devs that this code will be removed in a future version so they should move away from it as early as possible. It's fairly common and a much nicer way then just breaking things from one version to the next.
Magic numbers/strings are better replaced in code with constants. Things like ShowError(5); are not very clear, and it's preferable to use ShowError(NO_FILE_FOUND); or something. In previous versions code like new ItemStack(3); and new ItemStack(Material.DIRT); worked the same, but now the first one is being removed. Most bizarrely, Material.getMaterial(3);, which would convert 3 into dirt, is also deprecated so there is no clean way of turning an id into a material at the moment.
It's a very odd decision as Minecraft ids are well known and have been pretty stable for a long time now, so unless they know something about the future of them this feels like overkill.
As a user you won't be affected, it just means every developer must change hundreds of lines of code with no real (apparent) benefit.
Hi! Sorry, didn't want that to be interpreted as another "update plz" message, it's already working great. Waiting is not a problem, take your time, gives me something to look forward to.
So if I upgrade to Bukkit's new RB will it break this plugin? So far I have been avoiding it, give the dev's some time to catch up. If I update and stuff breaks, I've found that downgrading tends to break even more.
<angry/> got it, thanks!
<<reply 1781131="">>
Sorry, I've been so busy with the Windows Store app and my sons I have hardly been able to do anything recently :( There have also been many methods deprecated in the last Bukkit RB with no clear alternative to use.
I was working on the riding thing but it wasn't working as I had hoped (and worse, was stopping anything from spawning!) so I got a bit tied up on that.
There are two angry settings in the plugin, (random_)angry, which would do what you wanted for pig zombies and wolves, and anger-level, which sets how close to angry a pig zombie is. I'm not sure exactly how high the level gets and when it clicks over into angry, or what causes the level to rise though.
I don't think endermen can be made angry in code but I'll have a look and see if setting their target to a player achieves the same thing.
@Schlutteh
I'm fairly certain he's just been busy as I'm waiting for a reply on something as well... the dude probably has a life, give it a bit of time. :)
I don't think the "angry" variables are present in the code for those mobs, you would need a plugin probably.
I'll try commenting without replying, maybe that will notify. Or just chant your name three times!
C&T C&T C&T...
New question (in addition to below questions): How could I spawn wolves, or endermen, to be instantly hostile? Yeah, sometimes I just like to mess with my players... Not TOO much, just shake things up a bit, you know?
Still lovin' this plugin!
@coldandtired
Ok great, that's probably much easier to configure too. So would it be theoretically possible to have (mob) riding (custom mob) riding (custom mob) etc. with this method? I'm not requesting it though, just wondering.
Another thing, would it be possible to spawn mobs riding other entities such as boats? Although that may not be in-sync with the plugin's theme (or even possible).
<<reply 1749712="">>
The notification system seems to choose to only notify me about certain posts :(
Random-despawn means that some (roughly 50%) mobs will be marked as able to despawn, and the rest not. As by default animals don't despawn and hostiles do this means that the actual mobs changed by the setting is closer to 25% (e.g. animals which are randomly assigned not to despawn will be the same as before).
Mobs which can despawn do so when there is no player within 128 blocks (I believe).
The system I designed for the riding thing was that you would be able to do <riding>pig</riding> which would be a vanilla pig, or <riding>my_pig</riding>, where the plugin would look for a user-defined mob with that id and spawn it like normal (with whatever hp, equipment, etc. was defined), except as a vehicle.
I forgot to ask another thing about riding custom mobs, if possible, could the ridden mob have multiple elements?
Like:
<riding>horse
<variant>skeleton_horse, undead_horse</variant>
<name>Rattles, Rotty-Brains, Ivory-Keys, Horsemeat</name>
<despawn/>
</riding>
Although, the name really isn't important, despawning of the horses would be. Anyways, this plugin is already awesome so take your time!
@coldandtired
(edited)
Spawned undead/skelly horses with this:
<horse>
<id>cavalry</id>
<pack-limit>4</pack-limit>
<variant>skeleton_horse, undead_horse</variant>
<name>Rattles, Rotty-Brains, Ivory-Keys, Horsemeat</name>
<despawn/>
<spawn-if>
<biome>beach, desert, extreme_hills, forest, jungle, plains, swampland, taiga</biome>
<light>0 to 8</light>
<ground>grass</ground>
<blocks-from-player>above 23</blocks-from-player>
<blocks-from-spawn>above 23</blocks-from-spawn>
<success-rate>100</success-rate>
</spawn-if>
</horse>
But <random-despawn> seems to mean that they are randomly selected as able to despawn... not that they will despawn randomly. Is this correct? Probably could use an entry in the conditions/glossary pages.
Otherwise great, now I am one step closer to the cavalry of the (un)dead!
http://dev.bukkit.org/bukkit-plugins/spawns/files/10-1-6-2-b8/
Added most of the things requested recently. Mobs riding other custom mobs will take a little longer.
@coldandtired
10/10 if you could make this be per-mob as in the kinds of mobs that we define in the config, rather than all of one type of mob.
IE just one defined kind of horse vs all horses.
@coldandtired
You can do that? Awesome!
@Schlutteh I'll add the option to set whether any mob should despawn or not so they can be kept in check.