Posted June 11, 20178 yr Hi again, I have followed Shadowfact's tutorial, and now I have a working mod (here is the source) on client side. But at the server side it gives me an error: [14:14:59] [Server thread/ERROR]: Encountered an unexpected exception net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Testing mod (dtm) Caused by: java.lang.NoSuchMethodError: diniboy.TestMod2.item.ItemBase.setUnlocalizedName(Ljava/lang/String;)Lnet/minecraft/item/Item; at diniboy.TestMod2.item.ItemBase.<init>(ItemBase.java:13) ~[ItemBase.class:?] at diniboy.TestMod2.item.ItemOre.<init>(ItemOre.java:10) ~[ItemOre.class:?] at diniboy.TestMod2.item.ModItems.init(ModItems.java:14) ~[ModItems.class:?] at diniboy.TestMod2.TestMod2.preInit(TestMod2.java:31) ~[TestMod2.class:?] [...] Well, that's clear. The server hasn't got the setUnlocalizedName method. So I Cannot call that on server side. But is there a way to check if it is running now on a server or not? The world.isRemote would be nice, but I Cannot use that there (for example here), because I didn't find a method which returns the current world. Thanks!
June 11, 20178 yr That is weird. Last time I checked setUnlocalizedName had no SideOnly annotation so it should work fine on both server and client. In any case if you need to call methods that only exist on client use proxies.
June 11, 20178 yr Author 7 minutes ago, V0idWa1k3r said: In any case if you need to call methods that only exist on client use proxies. Okay, but in that case, I have to rethink the whole conception. The check might be a lazy solution. BTW Can You please compile the mod, and test it on a 1.11.2 forge server? Is it throw that error too for You? Thanks a lot!
June 11, 20178 yr Author Yes, that's the mod's source. But You Can build a jar from that with gradle.
June 11, 20178 yr 1) Just for grins, could you add a "this." in front of each call to each instance method and then recompile? 2) Did you compile your server jar using gradlew build? i ask because your build.gradle file looks like the default with group = "com.yourname.modid" still in it. The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
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.