adam9899 / Issues

14 stars 0 forks source link

Rats overspawning like mad - might know why #93

Open katubug opened 4 years ago

katubug commented 4 years ago

Hey again! My server was having insane TPS issues earlier (normally at 20, dropped to 5), and when I did /forge entity list I discovered that there were over 3300 rats in the world. I went to check their spawn rate in the config, and encountered this:

# Distance that untamed rats will immediately despawn. For Vanilla mobs, this is 128 blocks. [range: 0.0 ~ 3.4028235E38, default: 96.0]
    S:"Rat Immediate Despawn Distance"=true

If I had to guess, that may have been preventing them from guaranteed-ly despawning.

I'd also assume that was a mistype while customizing the pack (i know that feel lmao)? If not, lmk and I'll report it to the mod author instead. Thanks for your time!

katubug commented 4 years ago

Update: this does not seem to have helped. Roughly 3000 rats caused the same issue again this morning. It seems that they are spawning quite a lot under a certain player's base, so once those chunks are loaded, they go bonkers.

weightmaker commented 4 years ago

same issue here. even in SP the TPS drops down to 8-10 after just 2 days of playing. after 2 times of purging them, i just removed the mod. im pretty sure this is a mod issue and not a config error. I noticed they spawn as "tamed", which may be the issue. idk

v1.2

katubug commented 4 years ago

As a temporary workaround, I've added a few lines to my server's worldprimer config to cull all rats without nametags. If anyone else wants the code, it's here:

   worldprimer-timed-command %36000 0 scoreboard players tag @e[type=rats:rat,tag=!keep] add keep {PersistenceRequired:1b}
    worldprimer-timed-command %36000+1 0 kill @e[type=rats:rat,tag=!keep]

Specifically, that code will execute every 36000 ticks (30 real-world minutes), in dimension 0, with the commands /scoreboard players tag @e[type=rats:rat,tag=!keep] add keep {PersistenceRequired:1b} - which adds a scoreboard tag to all rats which have nametags (unless they were previously tagged). And then /kill @e[type=rats:rat,tag=!keep] - which kills any rats who have not been tagged.