-
-
Notifications
You must be signed in to change notification settings - Fork 36
registerReloadListener called on wrong thread
embeddedt edited this page Feb 6, 2026
·
1 revision
Resource reload listeners should not be added in FMLClientSetupEvent or FMLCommonSetupEvent; these fire in parallel with vanilla actually triggering the resource reload, so doing this causes several issues:
- Your listener will potentially be ignored, if it gets added to the list after the reload starts.
- If you add the listener on the wrong thread (very likely when using the setup events) it will potentially cause a
ConcurrentModificationExceptionto happen later during the resource reload (e.g. https://github.com/embeddedt/ModernFix/issues/512), with no trace as to which mod caused the issue.
In general, you should not need to use the vanilla registerReloadListener method directly. Prefer using the platform-provided events for adding reload listeners. (Neo)Forge already provides RegisterClientReloadListenersEvent for clients, and AddReloadListenerEvent for servers.