Crash when mobs spawn on the worldgen thread #32

Open
opened 2026-04-12 01:18:15 +00:00 by jwright159 · 1 comment
Description: Feature placement

java.lang.NullPointerException: Cannot invoke "net.minecraft.core.HolderLookup$Provider.lookupOrThrow(net.minecraft.resources.ResourceKey)" because "registries" is null
	at TRANSFORMER/enchiridion@0.2.0+1.21.1/house.greenhouse.enchiridion.util.EnchantmentCategoryUtil.getOptionalFirstEnchantmentCategory(EnchantmentCategoryUtil.java:217) ~[enchiridion-neoforge-0.2.0+1.21.1.jar%23449!/:0.2.0+1.21.1] {re:mixin,re:classloading}
    ...
	at TRANSFORMER/minecraft@1.21.1/net.minecraft.world.entity.Mob.enchantSpawnedWeapon(Mob.java:1145) ~[server-1.21.1-20240808.144430-srg.jar%23359!/:?]
    ...
	at TRANSFORMER/minecraft@1.21.1/net.minecraft.world.entity.monster.piglin.Piglin.finalizeSpawn(Piglin.java:213) ~[server-1.21.1-20240808.144430-srg.jar%23359!/:?] {re:classloading,pl:connector_pre_launch:A}
    ...
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) [?:?] {re:mixin,re:computing_frames}
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) [?:?] {re:mixin}

Continued from #30 (comment) since it's a different thing but yeah, the worldgen thread isn't the client or server thread and the threadlocal registry isn't set anywhere for the worldgen threads.

``` Description: Feature placement java.lang.NullPointerException: Cannot invoke "net.minecraft.core.HolderLookup$Provider.lookupOrThrow(net.minecraft.resources.ResourceKey)" because "registries" is null at TRANSFORMER/enchiridion@0.2.0+1.21.1/house.greenhouse.enchiridion.util.EnchantmentCategoryUtil.getOptionalFirstEnchantmentCategory(EnchantmentCategoryUtil.java:217) ~[enchiridion-neoforge-0.2.0+1.21.1.jar%23449!/:0.2.0+1.21.1] {re:mixin,re:classloading} ... at TRANSFORMER/minecraft@1.21.1/net.minecraft.world.entity.Mob.enchantSpawnedWeapon(Mob.java:1145) ~[server-1.21.1-20240808.144430-srg.jar%23359!/:?] ... at TRANSFORMER/minecraft@1.21.1/net.minecraft.world.entity.monster.piglin.Piglin.finalizeSpawn(Piglin.java:213) ~[server-1.21.1-20240808.144430-srg.jar%23359!/:?] {re:classloading,pl:connector_pre_launch:A} ... at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) [?:?] {re:mixin,re:computing_frames} at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) [?:?] {re:mixin} ``` Continued from https://git.greenhouse.lgbt/Modding/enchiridion/issues/30#issuecomment-500 since it's a different thing but yeah, the worldgen thread isn't the client or server thread and the threadlocal registry isn't set anywhere for the worldgen threads.
Owner

Mhm, seems interesting. I'll take a look into moving what I recently did for 26.1.x over here, as that's become a pretty foolproof strategy for validating categories.

Mhm, seems interesting. I'll take a look into moving what I recently did for 26.1.x over here, as that's become a pretty foolproof strategy for validating categories.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Modding/enchiridion#32
No description provided.