Water Creature Entities Continually Spawn and Overpopulate

Started by winterdrake on

Topic category: Help with MCreator software

Last seen on 22:56, 22. Apr 2024
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Water Creature Entities Continually Spawn and Overpopulate

I'm trying to make a custom biome that has axylotls and salmon as the main sea creatures in the lakes and ponds.

Currently, the axylotls and salmon continually spawn every few seconds (even though their spawn weight is set to 1) until they overpopulate and lag the game.

One thing I noticed was that the spawn weight guide suggested using decimal spawn rates for rare creatures, but the software auto-corrects anytime I put something less than 1. Is this a bug?

Last seen on 02:37, 13. Apr 2024
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Minecraft has mob caps for…
Mon, 05/22/2023 - 23:30

Minecraft has mob caps for different categories of mobs, but it only checks the specific category a mob is trying to spawn as, rather than the type it actually belongs to, before it decides whether it's allowed to spawn or not.

For example, if you currently have 70 "monsters" in render distance, the game will not naturally spawn another mob as if it were in the monster category. However, if you were to create a monster mob, but tell it to spawn like an "ambient" creature, the game will only check the ambient mob limit before allowing the monster to spawn- potentially leading to an endless number of them.

What I think you've got going on here is you're telling salmon and axolotls to spawn with a different spawn type than they're supposed to have. Salmon are supposed to be "water ambient", while axolotls have their own category: "axolotl".

Now, correcting their designated spawn categories may come with some issues, since they may no longer spawn how and where you want them to. They may not spawn at the height you want - especially the axolotls.

What I suggest is changing the salmon spawn type to water ambient and making a 'dummy' mob for the axolotl. What I've done for my mod is I made basic, invisible mobs called dolphinDummy, turtleDummy, etc, that have custom spawn conditions (the option at the bottom of the "Spawning" screen when you're editing an entity) and an 'On initial entity spawn' procedure, where after they spawn, they spawn the entity you want (dolphin, turtle, or in this case axolotl) and then despawn themselves.

I suggest you have a conditional procedure that basically goes:

'set custom bool allowSpawn to true,

for each entity as entity iterator ... in square cube with size 80'
if 'is iterator (sub)type of axolotl', add 1 to a counter,

if 'counter > 10', set allowSpawn to false,

return allowSpawn'

This way, you won't be restricted to having axolotls spawn in their natural environment and you're able to adjust how many you'd like to have in any given area.