Custom Spawns -- Configurable Mob Caps and Persistence
Fabric API and Cloth Config are required!
This is a simple server-side Fabric mod that allows you to configure various mob caps and persistence, as well as increase the rate of passive mob spawning. You can also use this to add or remove mob spawns from specific biomes.
Made as a companion mod to my old world gen mod, Modern Beta, you can use this to restore classic passive mob spawning!
=================================================================
Configuration
You can configure Custom Spawns through Mod Menu (recommended) or in the config/customspawn.json file.
The current options are:
Note: For the following options, please note the following formula used to calculate mob caps:
Actual Mob Cap = Mob Cap * Chunks [289 in Singleplayer] / (Spawn Chunk Constant ^ 2)
General
- chunkConstant (default: 17): Constant to modify actual mob cap.
- rareSpawnTicksToWait (default: 400): Number of ticks between rare mob spawn attempts. (20 ticks = 1 second)
Mob Spawn Group Options
- capacity: Maximum mob cap.
- peaceful: Whether mobs in this category are spawned as animals or monsters.
- rare: Whether mobs in this category are spawned with the customizable rare spawn tick timer.
- immediateDespawnRange: The distance at which mobs in this category immediately despawn, if not persistent.
- despawnStartRange: The distance at which mobs start to have a change to despawn, typically 40 seconds, if not persistent.
Mob Persistence
- passivePersistent (default: true): Enable/disable passive mob despawning.
- hostilePersistent (default: false): Enable/disable hostile mob despawning.
- ambientPersistent (default: false): Enable/disable ambient mob despawning.
- waterPersistent (default: false): Enable/disable water mob despawning.
Note: Non-persistent mobs can still be made persistent by renaming them or modifying the NBT tag. Saddled or tamed mobs should not despawn regardless of persistence setting.
Mob Spawn Additions
- biomeId: Fully-qualifed biome Identifier.
- mobId: Fully-qualified mob Identifier.
- spawnGroup: Spawn group for the mob to be placed in. Can be one of: MONSTER, CREATURE, AMBIENT, WATER_CREATURE, WATER_AMBIENT, UNDERGROUND_WATER_CREATURE (1.17+), AXOLOTLS (1.18+)
- weight: Spawn likelihood.
- minCount: Minimum group size.
- maxCount: Maximum group size.
Note: Mobs may have their own spawn restrictions outside of the spawn group they are placed in (e.g. Phantoms do not check for the light level before spawning, so if added as a natural spawn to an overworld biome, they will spawn in broad daylight even if placed under the MONSTER category).
Config example:
"biomeId": "minecraft:plains",
"mobId": "minecraft:pig",
"spawnGroup": "CREATURE",
"weight": 10,
"minCount": 4,
"maxCount": 4
}
Mob Spawn Removals
- biomeId: Fully-qualifed biome Identifier.
- mobId: Fully-qualified mob Identifier.
Config example:
"biomeId": "minecraft:plains",
"mobId": "minecraft:pig"
}
Mob Spawners
- overrideSpawnerDefaultValues: Toggle mob spawner settings. If you have custom spawners or another mod that modifies spawners, leave this off/false.
- minSpawnDelay: Minimum tick delay between spawn attempts.
- minSpawnDelay: Maximum tick delay between spawn attempts.
- spawnCount: Maximum number of mobs that may be spawned.
- maxNearbyEntities: Maximum number of nearby mobs of the same type before the spawn attempt fails.
- requiredPlayerRange: Spawner activation spherical radius.
- spawnRange: Mob spawn radius.
Following the Beta 1.2_01 spawning algorithm, to restore classic Beta mob spawning, use the following values:
- Spawn Chunk Constant: 15
- Creature Mob Cap: 15
- Passive Mob Rare Spawn: False
- Passive Mob Persistence: False
- All other options should be left at default.
Can this mod be configured to replicate classic mob spawning without removing persistence from bees?
How do you prevent certain mobs from spawning?
hi, is this compatible with Nox - A Mob and Difficulty Overhaul?
Hey please update to 1.18.2. Thanks!
Seems like the new update for this mod isn't working for 1.16.5, if anyone could help me it would be greatly appreciated.
How do I make mobs spawn between certain Y-levels?
For example, I want Iron Golems to spawn at Y-level 12-30.
Hello, i have a problem on my server :
Some Zombie and Zombified Piglin jockey despawn and leaves their chickens who does not despawn.
I dont find issue for this problem !
Can someone help me please !!!
hey i have a question which parameter i need to change if i want less mobs to spawn in my world?
I'm attempting to prevent all mobs from spawning in a certain biome via your mobSpawnRemovals feature- instead of listing out every mob in the game by hand, is there a catchall I can use?
EDIT: I added everything in by hand, and it simply appears to not be working. Mobs from the MobZ mod still spawn, regardless of being in the config. Any suggestions?
Edit: I realized I gave y'all nothing to go off of, Heres how I have my config set up:
I hope that clarifies whatever Im doing wrong!
Hi! Im sorry for bothering but Im getting this error when I launch the mod
[13:20:15] [main/ERROR]: Failed to load config 'class com.bespectacled.customspawn.config.CustomSpawnConfig', using default!
me.shedaniel.autoconfig.serializer.ConfigSerializer$SerializationException: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 21 column 2 path $
In reply to StreamingCell:
post your entire config , there is a error in line 21 and we cant see which one when u take out all other lines
In reply to Wackoamd:
That is everything in the config file, I can just attach the file here if you need to look at it. Thank you for responding!!
Link Removed: https://www.mediafire.com/file/09xx3aiojgh9dyd/customspawn.json/file
In reply to StreamingCell:
that config is messed up ;-) this is what the config should look like , i know because i had the same error but with me it was 1 comma that was at the wrong place.
edit: gave u the standard config , this one has already the mob spawn additions and removes so u can build on that
"chunkConstant": 17,
"rareSpawnTicksToWait": 400,
"monsterGroup": {
"capacity": 70,
"peaceful": false,
"rare": false,
"immediateDespawnRange": 128,
"despawnStartRange": 32
},
"creatureGroup": {
"capacity": 10,
"peaceful": true,
"rare": false,
"immediateDespawnRange": 128,
"despawnStartRange": 32
},
"ambientGroup": {
"capacity": 15,
"peaceful": true,
"rare": false,
"immediateDespawnRange": 128,
"despawnStartRange": 32
},
"axolotlGroup": {
"capacity": 5,
"peaceful": true,
"rare": false,
"immediateDespawnRange": 128,
"despawnStartRange": 32
},
"waterCreatureGroup": {
"capacity": 5,
"peaceful": true,
"rare": false,
"immediateDespawnRange": 128,
"despawnStartRange": 32
},
"waterAmbientGroup": {
"capacity": 20,
"peaceful": true,
"rare": false,
"immediateDespawnRange": 64,
"despawnStartRange": 32
},
"undergroundWaterGroup": {
"capacity": 5,
"peaceful": true,
"rare": false,
"immediateDespawnRange": 128,
"despawnStartRange": 32
},
"passivePersistent": true,
"hostilePersistent": false,
"ambientPersistent": false,
"waterPersistent": false,
"mobSpawnAdditions": [],
"mobSpawnRemovals": [
{
"biomeId": "minecraft:cold_ocean",
"mobId": "minecraft:salmon"
},
{
"biomeId": "minecraft:river",
"mobId": "minecraft:salmon"
},
{
"biomeId": "minecraft:plains",
"mobId": "minecraft:slime"
}
],
"overrideSpawnerDefaultValues": false,
"minSpawnDelay": 200,
"maxSpawnDelay": 800,
"spawnCount": 10,
"maxNearbyEntities": 6,
"requiredPlayerRange": 64,
"spawnRange": 4
}
When I open the game it says this
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils$$Lambda$567/2075933550.apply(Unknown Source)
at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33)
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:49)
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke(EntrypointUtils.java:35)
at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:157)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:71)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils$$Lambda$567/2075933550.apply(Unknown Source)
at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33)
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:49)
at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke(EntrypointUtils.java:35)
at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:157)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:71)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at me.shedaniel.autoconfig.ConfigManager.(ConfigManager.java:53)
at me.shedaniel.autoconfig.AutoConfig.register(AutoConfig.java:66)
at com.bespectacled.customspawn.CustomSpawn.(CustomSpawn.java:18)
... 21 more
This only happens with the mod installed.
Is chunkConstant meant to be high for more spawn or low for more spawns?
If I use the mob addition on a mob from a mod, will that allow me to adjust its spawn weight down? Some of my mod-based mobs are spawning way too often and lack a config.
"mobSpawnRemovals": [
{
"biomeId": "minecraft:cold_ocean","minecraft:river",
"mobId": "minecraft:salmon"
},
{
"biomeId": "minecraft:plains",
"mobId": "minecraft:slime"
}
],
what is wrong with this?
server log keeps complaining about not loading ;-(
In reply to Wackoamd:
You'll have to separate the Cold Ocean and River Salmon removal entries, i.e.
{
"biomeId": "minecraft:cold_ocean",
"mobId": "minecraft:salmon"
},
{
"biomeId": "minecraft:river",
"mobId": "minecraft:salmon"
}
In reply to b3spectacled:
thanks allot
since we can niow remove mobs , is there a way to remove a mob from every biome or do i have to type in every biome seperate , comma seperated ?