
is there a way to limit total mob spawns?
Closed this issue · 7 comments
I'm making a mod pack and mobs tend to build up when i stay in one place for too long, is there a way to make it so there can only be a total of 20 mobs around the player? I can't seem to find anything on the wiki for this.
this is what i tried:
[
{
"mob": "minecraft:chicken",
"result": "allow"
},
{
"result": "deny"
},
{
"maxcount": 20,
"result": "deny"
}
]
i also tried putting the "maxcount" to "mincount"
Ok, let's break this down. Rules are executed from top to bottom. First rule that matches is executed, the rest is ignored. Let's say a mob spawns. It will scan these three rules one by one:
- Rule 1: is it a chicken? If yes it will spawn (regardless of the count). Otherwise on to the next rule
- Rule 2: deny the mob. No more rules will get executed since this one will always work. It has no conditions
- Rule 3: not really important since this rule will never get executed but note that you need 'mincount' in combination with deny
So think about this a bit more. Consider that order is important