Jump to content

Jar mod doesn't work [1.15.2]


mdcby

Recommended Posts

2 minutes ago, diesieben07 said:

What is the behavior if you use the jar file?

Just nothing happens. When I run compiled minecraft, it applies potion effect whenever a player kills a mob. With jar it stands still.

Link to comment
Share on other sites

25 minutes ago, diesieben07 said:

Sometimes it crashed the game with NoSuchMethodException when the src didn't have the method getTrueSource, for example when entity was killed by a block.

Edited by mdcby
Link to comment
Share on other sites

2 minutes ago, diesieben07 said:

That's.... thats not how Java works.

If src did not have that method all the time, your code would not compile

NoSuchMethodException is something thrown by reflection code.

I got this exception when bat suffocated maybe because of gravel. Blocks dont have this method, but living entities do.

But ok let's say there is a problem, then why it works properly when compiled?

Link to comment
Share on other sites

36 minutes ago, diesieben07 said:

Show the stacktrace.

 

The actual game is obfuscated. When you run the build task, ForgeGradle reobfuscates your mod, updating references to Minecraft's methods and fields. But since you use "getTrueSource" in a string, this will not be updated. In the normal game there won't be a method called "getTrueSource", so your event handler always bails out.

I removed this part and tried to repeat this issue, but seems like everything is working.

That time i got this:crash-2020-05-11_21.37.49-server.txt

Link to comment
Share on other sites

6 minutes ago, mdcby said:

I removed this part and tried to repeat this issue, but seems like everything is working.

That time i got this:crash-2020-05-11_21.37.49-server.txt

Are you using deobfuscated names for reflection, because that's very wrong. If you are replace them with the names from MCP. (Incase you don't know what deobfuscated and obfuscated means,getTrueSource -> func_76346_g)

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

8 minutes ago, diesieben07 said:

They are not. NoSuchMethodError is not something reflection produces.

 

You did not use the gradle build task to build your mod.

ohh maybe i really didn't use gradle build without this check, since it works now then thanks ?

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.