StackOverflowError caused by random spawns

Summary

Dev builds since the last spawning rewrite raise StackOverflowError exceptions due to random spawning

Steps to reproduce

Install the latest MM builds

Create a mob with random spawning

Mob: https://pastebin.com/A0UrW6RG

Random spawn: https://pastebin.com/8Fxjs2J1

Move across the world, exceptions will be thrown in the console

Current behavior

Random spawning cause random exceptions in the console

Intended correct behavior

Random spawning working as expected

Server log file

https://pastebin.com/AkcLQK5X

Debug log snippet

https://pastebin.com/ntgcat4L

Assignee Loading
Time tracking Loading