Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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!

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.

  • 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. :D

 

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!

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.