ChunkBreedLimit
Overview
ChunkBreedLimit is a lightweight, easily configurable plug-in designed for server administrators whom wish to cap the number of passive, breeding-capable entities on their server per chunk, instead of imposing a flat server limit on all users.
Breeding attempts made by entities when the total number of allowed entities present on their chunk is greater than the allocated amount will fail, with no new animal being spawned. Future additions to the code will prevent this at the player level as well - but I just wanted to get this out there initially. This is of particular use for town-based servers where players are prone to hoarding immense quantities of livestock for use in economy or for their drops. ChunkBreedLimit does -NOT- interfere with ordinary chunk loading or entity spawning - it only intercepts the event that is called when a player deliberately causes animals to breed.
Configuration options
spawn-cap: Determines the maximum amount of entities in entity-list allowed per chunk before breeding is disabled
entity-list: Any mob entity capable of breeding may be included/excluded in this list. All entities contained within this list will count towards a chunk's maximum entity count and is flexible with other server mobs that add new breeding-ready entities, as long as they have a valid EntityType.
breeding-fail-msg: Determines the message shown to players when breeding is blocked due to chunk overcrowding of allowed entities.
As of ChunkBreedLimit 1.3:
use-individual-cap: Determines whether the plugin uses individual entity limit checking (requires entity-list-individual set below). True enables this, false uses default behavior from previous versions. (Default is false)
entity-list-individual: A list of the entity types that you wish to control with the plugin, with their cap seperated by a comma.
Configuration examples:
spawn-cap: 75 breeding-fail-msg: "The animal refuses the wheat - it is too crowded to breed!" entity-list: - cow - chicken - pig
The above config.yml template would cap cow, chicken and pig entities together within the same chunk to a maximum of 75 - any further breeding of these entities will simply fail. However, since sheep are not within entity-list, they may be bred freely and infinitely as much as resources allow. Including hostile mobs in the entity-list will make them count towards the breeding limit, allowing server administrators to force players to have farmland which is safe from monsters before they may breed more.
use-individual-cap: true entity-list-individual: - cow, 20 - sheep, 30 - mushroom_cow, 30 - pig, 15
This configuration template will limit cows to 20 per chunk, sheep to 30 per chunk, mooshrooms to 30 per chunk and pigs to 15 per chunk. Note that if use-individual-cap is true, spawn-cap and entity-list will be ignored.
Future additions
I intend on extending ChunkBreedLimit to work with Towny and allow server administrators to determine a town's chunk breeding limit depending on its size and player count, and to cap the breeding activity at the player as well as on the entity spawn event.
Code Repositories
ChunkBreedLimit's incredibly simple source is freely available at GitHub. You may use it in your projects freely - but please contact me first if you wish to add it to another plugin entirely!
Donations
I am currently a university student studying psychology in Sydney, Australia. This leaves me with comparatively little time to pursue programming, which I adore as my hobby. Donations or otherwise, I will maintain this for as long as I have the time, and donations will only encourage me to scrounge more time to sink in to it! That and I'd love to have someone buy me lunch from across the world. But thank you in any case!
@xBladeM6x
Not in the latest build no, but that does sound like an excellent feature request addition. I'll hop right on to that.
Alright, so I found my problem. I'm attempting to do this:
http://pastebin.com/8CmXh5M2
I'm basically trying to set a cap for normal, typical animals, however disable the ability to breed Mooshrooms. However when I set the config to look like this, it works, but if there's a mooshroom in the chunk, it kills all the spawning of other mobs within the chunk. Any way to set multiple different spawn-caps for different animals?
@dickwick
The latest version of ChunkBreedLimit handles spawner egg events as well.
@Ephemeralis
Residence
Very similar to Towny. With it you can limit the amount of residences (plots of land) a player has and the total size each. With residence you'd be able to allow a person so many animal per plot, or farm, or whatever they're using their land for.
I know that's probably a tall order though, to make it compatible with Residence. But it'd be really cool.
Hello, I like your plugin, but I would like to see a way to stop "breeding" even from Egg Spawners. I have EggCatcher plugin and people are catching chickens and making egg farms filling them with chicknes from spawner eggs. Is there any way how to block this thing too? Or using any other plugin? Thanks!
@tdbruce34
I am unfamiliar with the residence plugin that people keep mentioning. Could you provide a link? I trust it is somewhat similar to Towny, or therein.
Residence support would be awesome. I can't believe this hasn't had more downloads. I think it's perfect to keep people from causing server or client lag from breeding an unnecessary amount of animals and haven't been able to find anything else similar to it.
@erickingsr
I'm not sure that's actually possible - this doesn't touch anything regarding chunk loading, it only intercepts the breeding events! I have no issues using my own plugin on a 320 player server that I administrate - it is likely an issue with your configuration.
It would be really helpful if you add residence support to this. Only X monsters per residence.
Just FYI
Tested the plugin on my server. Caused massive Chunk Loading Lag.
Nice Plugin. Good work!
Best regards, Eric
http://ckmgaming.net
maybe add mob eggs? because i sell them to users in my market i dont want them to abuse and lag the server?