The Endergetic Expansion

The Endergetic Expansion

25M Downloads

[1.16.5] Endergetic mobs constantly spawning and building up to excessive quantities when Respawnable Animals is installed

NJL5390 opened this issue ยท 9 comments

commented

Minecraft Version: 1.16.5
Forge Version: 36.0.13
Respawnable Animals Version: 1.0.2
Endergetic Expansion Version: 3.0.0
Abnormals Core Version: 3.0.6

Latest Client Log: https://pastebin.com/2vWLiDZh

Hi,
When testing a modpack I've been putting together I found that when I have a mod called "Respawnable Animals" installed it causes a huge amount of booflos and puff bugs to build up as they keep spawning constantly when near a poise forest. This forces me to either leave the area to despawn the mobs or to use a command to kill them all so that my game doesn't lag out and crash.

Now it should be noted that Respawnable Animals completely changes how mobs spawn so it very well could be an issue on their end, but I am posting this issue here nonetheless in case there is something you guys can do about it and to let you know that this issue exists.

Here's some screenshots to show what I'm talking about:
2021-01-31_14 33 23
2021-01-31_14 54 36

Here's a link to the mod's Curseforge page: https://www.curseforge.com/minecraft/mc-mods/respawnable-animals

Here's a link to the same issue on their github: Fuzss/respawninganimals#3

commented

Unfortunately, I don't know entirely what Respawnable Animals is doing that could cause this, but my guess would be that Booflos and Puff Bugs breed a lot and it might lead to them not despawning.
I'm going to wait for a response from them on their issue tracker.

commented

The behavior is triggered as my mod changes the spawning cooldown for animals from 400 to 0 ticks. I've now changed the behavior for this to only apply for the CREATURE classification.

But from my understanding this actually exposes a bug in Endergetic: Your Puffs and Booflos are classified as CREATURE in EEEntities.java. In EEBiomes.java though they are registered as your own END_CREATURE classification type to the spawning list. This means the mob cap for the END_CREATURE classification can never be reached as the world spawner only ever finds entities classified as CREATURE. This results in the world spawner never stopping to spawn the END_CREATURE classification, making your mobs pile up infinitely since they also seem to be unable to despawn. All in all a behavior my mod only seems to accelerate.

commented

I also noticed there seems to be a call to super missing here. Vanilla has added some behavior to the base method in 1.16.

commented

I also suspected that mismatched entity classifications were the cause, but it didn't go very well when I tried to fix that.
When using END_CREATURE for both the entity's classification and spawn classification, there were very little, and sometimes no spawns at all.
I tested some different type combinations, and here's what I found:

C - Creature
E - End Creature
M - Monster
Main Classification Spawn Classification Result
C C Little to no mob spawns
E E Little to no mob spawns
M M Little to no mob spawns (seems to fluctuate?)
C E Comfortable mob spawns but builds up very slowly
E C Tiny mob spawns and builds up very, very slowly
E M Tons of mob spawns; ends up like the screenshots above
C M Tons of mob spawns; ends up like the screenshots above

I'm not sure what's causing this, but it appears that when using the same classification for the entity and spawning, there is nearly no spawning at all. Which makes me believe it has something to do with the cap?
Any ideas to fix this are welcome.

commented

Why not CREATURE for both? This way your mobs will mainly spawn on world gen just like vanilla animals do. I really wouldn't recommend going for two different classification as they will lead to mobs spawning and piling up infinitely.

Using the MONSTER classification spawns mobs so much faster as there is a 400 tick cooldown when spawning something animal related, for monsters there is no such cooldown between spawn cycles though.

commented

With CREATURE for both, there are barely any mobs spawning, which isn't how the Poise Forest is supposed to be.

commented

For the puff bugs, perhaps it would work to follow the spawn pattern of bees; generated with the hives, and only spawning naturally on occasion (creature classification), guaranteeing some to exist without overdoing it.
Booflos on the other hand seem to be more of a neutral-hostile creature, so following the spawn pattern of hoglins could work (presumably the hostile spawn classification). That would also guarantee that they don't overlap with puff bug spawns, ensuring more of each will appear.

commented

That solution won't work.
Taking a look back at the chart, using CREATURE would result in barely any mob spawns, which would lead to Puff Bugs nearly never naturally spawning besides generation.
Booflos are neutral, so it doesn't make sense for them to be MONSTER. MONSTER would also result in an incorrect rate of Booflo spawning.

commented

It seems like the passive spawning limitations will not work for the desired mob counts, therefore using the MONSTER spawn classification with more fine-grained control may be the closest one can get; the combined use of spawn chances and spawn costs (the mechanic used to limit the number Endermen in the warped forests) would allow a higher cap without spawning too many of these mobs. Afterall, this is what the Endermen use, and they are also "neutral".
As long as puff bugs take those costs into account when reproducing, it shouldn't produce too many of them.