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!
i made an area of 32x32 and spawned there thousand sheeps. big server lag, this doesn't work?
this currently works with latest versions.
this plugin sounds great. Anyone know of another one that works with current versions?
Testing this out :)
please add no spawn in chunk with egg :s
Since breeding has changed, and different items are used to breed, this plugins only partially working. The details I posted here:
http://forums.bukkit.org/threads/breeding-limiting.111210/
@kustomcraft
This plugin is for breeding mobs using wheat, not spawn eggs...
Does this plugin still work for anyone?
Im a default user, and i am spawning more then 20 mobs with spawn eggs, it is allowing me and not working how it should, this is my config..
Alright if anyone is lazy and wants everymob use my config :P
spawn-cap: maximum number of entities per chunk before breeding is disabled entity-list: mobs that are counted in a chunk's total count breeding-fail-msg: message sent to the player when breeding is disabled due to chunk capacity spawn-cap: 20 breeding-fail-msg: "The animal shuffles about nervously.. It is too crowded for it to breed!"
entity-list: - BLAZE - CAVE_SPIDER - CHICKEN - COW - CREEPER - EGG - ENDER_DRAGON - ENDERMAN - GHAST - GIANT - IRON_GOLEM - MAGMA_CUBE - MUSHROOM_COW - OCELOT - PIG - PIG_ZOMBIE - SHEEP - SILVERFISH - SKELETON - SLIME - SNOWMAN - SPIDER - SQUID - VILLAGER - WOLF - ZOMBIE
use-individual-cap: specify whether you wish to use the individual entity list and individual entity limit checking use-individual-cap: false entity-list-individual: (entitytype, spawnlimit) entity-list-individual:
would be great to set that per worldguard region too instead of chunk!
Alright if anyone is lazy and wants everymob use my config :P
spawn-cap: 20 breeding-fail-msg: "The animal shuffles about nervously.. It is too crowded for it to breed!"
entity-list: - BLAZE - CAVE_SPIDER - CHICKEN - COW - CREEPER - EGG - ENDER_DRAGON - ENDERMAN - GHAST - GIANT - IRON_GOLEM - MAGMA_CUBE - MUSHROOM_COW - OCELOT - PIG - PIG_ZOMBIE - SHEEP - SILVERFISH - SKELETON - SLIME - SNOWMAN - SPIDER - SQUID - VILLAGER - WOLF - ZOMBIE
@kustomcraft
http://jd.bukkit.org/apidocs/org/bukkit/entity/EntityType.html
Anything that is a creature and is in that list will work.
How do i make all mobs limited to what ever, instead of writing every mob as i don't know the technal bukkit name?
entity-list: - pig - cow - chicken - sheep
eg maybe do this?
entity-list: - all
no config file was genartated
@xBladeM6x
1.3 is out, by the way.
@Ephemeralis
When it's available, I shall make sweet, dirty, disgusting, downright wrong types of love to it. <3 xD
Edit: Only thing that seems left to do, is the per-user limit. :3
@xBladeM6x
I had to substantially rewrite the way the event handling was done, so you'll just have to wait for the moderators to approve 1.3, I guess.
@Ephemeralis
Surprisingly, I don't know how to get it from GitHub. Lol. Did you update the .jar or make it something done in the config? o-O However, I shall be refreshing the page repeatedly over and over, and over, and over. xD
@xBladeM6x
I've finished the addition and pushed it for approval to BukkitDev. It's already on the github if you want to compile it yourself in the meantime.
@Ephemeralis
If you could push that out, I would <3 you forever. :3
No seriously. Breeding insanely is a huge problem on my server. This is a must. xD