[Bug]: Random world deadlock on NEARBY_PLAYERS_MEAN calculation
Mod Version
0.9.5
Hytale Version
2026.02.06-aa1b071c2
Describe the bug
Worlds seem to randomly end up in a deadlock situation when using LevelingCore. The stacktrace is observed using a custom thread dumper:
[2026/02/09 19:00:00 SEVERE] [Watchdog] Thread: WorldThread - default (ID: 159):
[2026/02/09 19:00:46 SEVERE] [Watchdog] at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:223)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at [email protected]/java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1885)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at [email protected]/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:4364)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at [email protected]/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:4310)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at [email protected]/java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1919)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at [email protected]/java.util.concurrent.CompletableFuture.join(CompletableFuture.java:2138)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at com.hypixel.hytale.server.core.universe.world.World.getPlayers(World.java:751)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at ThirdPartyPlugin//com.azuredoom.levelingcore.utils.MobLevelingUtil.computeNearbyPlayersMeanLevel(MobLevelingUtil.java:136)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at ThirdPartyPlugin//com.azuredoom.levelingcore.utils.MobLevelingUtil.lambda$computeDynamicLevel$0(MobLevelingUtil.java:46)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at ThirdPartyPlugin//com.azuredoom.levelingcore.utils.MobLevelingUtil$$Lambda/0x00000000273a7000.apply(Unknown Source)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at [email protected]/java.util.Optional.map(Optional.java:260)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at ThirdPartyPlugin//com.azuredoom.levelingcore.utils.MobLevelingUtil.computeDynamicLevel(MobLevelingUtil.java:42)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at ThirdPartyPlugin//com.azuredoom.levelingcore.systems.level.MobLevelSystem.lambda$drainPending$0(MobLevelSystem.java:136)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at ThirdPartyPlugin//com.azuredoom.levelingcore.systems.level.MobLevelSystem$$Lambda/0x00000000273a5c00.run(Unknown Source)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at com.hypixel.hytale.server.core.universe.world.World.consumeTaskQueue(World.java:904)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at com.hypixel.hytale.server.core.universe.world.World.tick(World.java:419)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at com.hypixel.hytale.server.core.util.thread.TickingThread.run(TickingThread.java:89)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at [email protected]/java.lang.Thread.runWith(Thread.java:1487)
[2026/02/09 19:00:46 SEVERE] [Watchdog] at [email protected]/java.lang.Thread.run(Thread.java:1474)
Specifically, the line of interest is MobLevelingUtil.java:136 where it calls World#getPlayers. Calling this from a non-world thread may result in the world freezing, but it is currently unknown under what situation this is invoked from a non-world thread.
To Reproduce
- Steps unknown, currently investigating...
I'm trying to clean up parts of the code in the hopes of fixing the issue, but it's really unclear what exactly is wrong here. I can share the branch as a PR if you want to help.
Currently I'm removing some of the World#execute scheduling around MobLevelSystem as I think you shouldn't need a lot of them inside a system for the same world
Hmm yeah this is an odd one, if you wanna throw up a draft pr with your work, I can poke in as well!
I think I should move to use chunks instead to get players instead of all the players in the world similar to how i do nameplates. Hmm will test here tomorrow with a massive overhaul as I want to support level ranges as well.
Based on some feedback from other devs in the community, looks like this is a Hytale bug more than a bug with levelingcore itself and is known by the devs but no ETA on a fix yet. Suggestion was to try adding Djava.util.concurrent.ForkJoinPool.common.parallelism=16 to your servers launch parms if possible. It's not a complete fix but a stop gap until fixed Hytale side.
Oh, thank you for the information! Didn't know about the launch parameter.
Let me know if it helps!
Sorry for late reply, I've had to deal with some exams.
In that time, my server had been running a version of LevelingCore with little refactors around World.execute() calls, and it didn't experience any crashes related to this plugin.
However, when I updated LevelingCore to latest release build as preparation for Hytale Update 3, the same crash started to occur even with the parallelism flag set to 16.