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.
In reply to Forge_User_46078887:
I've also just seen some mistakes in your file. The closing element must match the opening one, so </hub> must be </first_hub> and </pack> must be </first_pack>
You can open an xml file with any browser and check whether it looks good or you get error messages,
In reply to coldntired:
Here the result of mv list : http://prntscr.com/p7zr0p
My new config file : https://hastebin.com/oxukadayih.xml
But i still have "No valid worlds defined - stopping"
In reply to Forge_User_46078887:
I'm uploading a new version which shows some debug info when the plugin starts. Please have a look and paste it here.
In reply to coldntired:
New logs : https://hastebin.com/itugexilup.css
I renamed files and it works well now.
My new config file is : https://pastebin.com/W9iwmmQC
I reduced the number of mobs which can spawn so it's a bit slow, like i need.
But i have some questions :
- Can I limit the number of mobs around a player and/or per chunk ?
- I would like to allow mobs to spawn only if they are at least 30 blocs away from a player with "<blocks-from-player>30..</blocks-from-player>" but it looks it doesn't works. What i am doing wrong ?
- Mobs took some damages when they spawn spawn because sometimes they spawn a few blocks above the ground. Can I avoid that ?
Thanks for you help !
In reply to Forge_User_46078887:
You're not too far off. The plugin (and Minecraft itself, unless something has changed recently) spawns mobs in 'orbits'. Each player is the centre (the sun), which has packs around it (planets) and these have mobs around the pack centres (moons).
The plugin will go though each timer and each player. First it will check any <start-if> conditions. If they all pass it will select the packs using the <select-if> conditions. If these all pass that pack is chosen. Then it chooses some blocks around the centre and finds which mobs can spawn there.
So the issue with your config is that the conditions are not inside a condition block. You need something like this (notice also the second condition is reversed. Your version would only spawn if there were more than 500 mobs in the world):
In reply to coldntired:
Thanks for these explanations, it helps me much but I still have questions.
My new config : https://pastebin.com/9gyQzvfU
When you say : " If these all pass that pack is chosen. Then it chooses some blocks around the centre and finds which mobs can spawn there."
How i could avoid to spawn mobs into the air instead of into a block ? The plugin can't know if the block is solid or not when it generates the pack so the block-is-solid can't work in that way. I tried to check it with block-is-solid and ground-is-solid at each start-if (like you can see in my config) but mobs still spawn in the air.
I still not find a way to limit how much mobs there is inside an area and/or per chunk, what should i do ? I would like to reach this limit quite fast (around 10/20s) and then mobs will stop spawning. It's like the vanilla spawning algorithm but your plugin allow me to go further (like allowing mobs during day, manage packs and how much mobs per pack, ...).
In reply to Forge_User_46078887:
The <start-if> condition block only works on timers. It would be a good place for your world_has_spawned condition as it only gets called once per interval.
All the other levels of the config (hubs, etc.) use the <select_if> condition block so your checks for solid ground need to be in there.
There are timer/hub/pack_has_spawned conditions so you can control how many spawn each interval but there doesn't seem to be one for mobs around the player. It's odd as I remember writing it but it must have been for another plugin. I'll see if I can find it and implement it here.
In reply to coldntired:
Ok i finally found a way to avoid mobs spawning in the air. I found a solution to spawn at the good rate too.
Let me know about the condition for mobs around the player :).
can you make pigs/cows spawn mid air instead of needing grass or light? and make slimes spawn at any height?
working on 1.13? Just wondering.
In reply to zachrywilsn:
But how to increase the mob spawn rate?
Confirmed working in 1.12.2
Haven't tried any of the new mobs, but my old config's still work :)
I recently updated to Spigot 1.12.1 and Spawns 1.12 b1 is working great. So it will probably work fine with 1.12.2 as well, I'll post again when I update.
Question! Will this work right with mythicmobs?
Awesome work BTW :)
It's been a long time but I still actively use this plugin! Now, I hate it when people pester for updates but I do recall you mentioning that you don't keep up with Minecraft these days so I thought to mention that the Bukkit API is starting to reach maturity for 1.12 (apparently some dependencies have changed).
I'm holding off my update for a while longer to wait for a few things to catch up, and while I would love to have Spawns for the new mobs in 1.12 - please don't feel pressured to update!
In reply to Schlutteh:
In reply to coldandtired:
In reply to coldandtired: