Jump to content

IntelliJ RunServer failure: java.lang.RuntimeException


dun

Recommended Posts

I've been trying to runServer my mod, but everytime I try, this happens:

---- Minecraft Crash Report ----
// Shall we play a game?

Time: 6/20/22 9:52 AM
Description: Mod loading error has occurred

java.lang.Exception: Mod Loading has failed
	at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:85) ~[forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-recomp.jar:?] {re:classloading}
	at net.minecraftforge.fml.server.ServerModLoader.load(ServerModLoader.java:51) ~[forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-recomp.jar:?] {re:classloading}
	at net.minecraft.server.Main.main(Main.java:95) ~[forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-recomp.jar:?] {re:classloading}
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_261] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_261] {}
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_261] {}
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_261] {}
	at net.minecraftforge.userdev.FMLUserdevServerLaunchProvider.lambda$launchService$0(FMLUserdevServerLaunchProvider.java:54) ~[forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-recomp.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:108) [forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-recomp.jar:?] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: main
Stacktrace:
	at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClassWithFlags(RuntimeDistCleaner.java:71) ~[forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-launcher.jar:36.2] {}
-- MOD goety --
Details:
	Mod File: main
	Failure message: Goety (goety) has failed to load correctly
		java.lang.RuntimeException: Attempted to load class net/minecraft/client/entity/player/ClientPlayerEntity for invalid dist DEDICATED_SERVER
	Mod Version: NONE
	Mod Issue URL: NOT PROVIDED
	Exception message: java.lang.RuntimeException: Attempted to load class net/minecraft/client/entity/player/ClientPlayerEntity for invalid dist DEDICATED_SERVER
Stacktrace:
	at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClassWithFlags(RuntimeDistCleaner.java:71) ~[forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-launcher.jar:36.2] {}
	at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:85) ~[modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:265) ~[modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:136) ~[modlauncher-8.0.9.jar:?] {re:classloading}
	at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) ~[modlauncher-8.0.9.jar:?] {re:classloading}
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_261] {}
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_261] {}
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_261] {}
	at net.minecraftforge.fml.AutomaticEventSubscriber.lambda$inject$6(AutomaticEventSubscriber.java:75) ~[forge:?] {re:classloading}
	at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_261] {}
	at net.minecraftforge.fml.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:62) ~[forge:?] {re:classloading}
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:91) ~[forge:36.2] {re:classloading}
	at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:120) ~[forge:?] {re:classloading}
	at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1640) ~[?:1.8.0_261] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java) ~[?:1.8.0_261] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) ~[?:1.8.0_261] {}
	at java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:289) ~[?:1.8.0_261] {}
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java) ~[?:1.8.0_261] {}
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_261] {}
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_261] {}
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:172) ~[?:1.8.0_261] {}


-- System Details --
Details:
	Minecraft Version: 1.16.5
	Minecraft Version ID: 1.16.5
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_261, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 1211719680 bytes (1155 MB) / 1751121920 bytes (1670 MB) up to 3799515136 bytes (3623 MB)
	CPUs: 8
	JVM Flags: 1 total; -XX:+IgnoreUnrecognizedVMOptions
	ModLauncher: 8.0.9+86+master.3cf110c
	ModLauncher launch target: fmluserdevserver
	ModLauncher naming: mcp
	ModLauncher services: 
		/mixin-0.8.4.jar mixin PLUGINSERVICE 
		/eventbus-4.0.0.jar eventbus PLUGINSERVICE 
		/forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-launcher.jar object_holder_definalize PLUGINSERVICE 
		/forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-launcher.jar runtime_enum_extender PLUGINSERVICE 
		/accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE 
		/forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-launcher.jar capability_inject_definalize PLUGINSERVICE 
		/forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-launcher.jar runtimedistcleaner PLUGINSERVICE 
		/mixin-0.8.4.jar mixin TRANSFORMATIONSERVICE 
		/forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1.16.5-launcher.jar fml TRANSFORMATIONSERVICE 
	FML: 36.2
	Forge: net.minecraftforge:36.2.20
	FML Language Providers: 
		javafml@36.2
		minecraft@1
	Mod List: 
		client-extra.jar                                  |Minecraft                     |minecraft                     |1.16.5              |CREATE_REG|Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
		forge-1.16.5-36.2.20_mapped_parchment_2021.10.17-1|Forge                         |forge                         |36.2.20             |CREATE_REG|Manifest: NOSIGNATURE
		curios-forge-1.16.5-4.0.5.3_mapped_parchment_2021.|Curios API                    |curios                        |1.16.5-4.0.5.3      |CREATE_REG|Manifest: NOSIGNATURE
		Patchouli-1.16.4-53.2_mapped_parchment_2021.10.17-|Patchouli                     |patchouli                     |1.16.4-53.2         |CREATE_REG|Manifest: NOSIGNATURE
		main                                              |Goety                         |goety                         |NONE                |ERROR     |Manifest: NOSIGNATURE
		jei-1.16.5-7.7.1.144_mapped_parchment_2021.10.17-1|Just Enough Items             |jei                           |7.7.1.144           |CREATE_REG|Manifest: NOSIGNATURE
	Crash Report UUID: 0b81f683-05b4-49b5-9d31-70e1165fbe06

I'm trying to figure out why it keeps trying to load ClientPlayerEntity for DEDICATED SERVER, and I can't seemed to find anything in both Crash Report and Debug on which part of my mod is causing this problem. Can someone explain what's happening.

Link to comment
Share on other sites

I figure out the problem!

To any one who's having problems with runServer here's some stuff I did/noticed:

Use @OnlyIn(Dist.CLIENT), you might seen some posts saying that it's useless or that it's just something for Mojang, but putting these on certain functions, like particles, helps prevent crashes.

If you have a Mob that implements IChargeableMob, always put 

@OnlyIn( value = Dist.CLIENT, _interface = IChargeableMob.class ) before it.

Don't register ItemModelsProperties directly on your custom Item class, put that in your Client Events where you register renderers and models.

Also, don't use Minecraft.getInstance().level for your networks/packets. Use Proxies.

Edited by dun
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.