Jump to content

Someone could tell me how Forge works with mod jar?


Blu3Fat

Recommended Posts

Recently I am trying to add some resource into a jar through java. By that I could insert some extern resource like songs when I launch the game. And then I learned about how to insert something into a jar through java. But it seems like we could just "override" a jar but not "insert". That's to say,we have to copy and paste whole jar file then add our files into it. And everytime we do it,we just create a new jar(although it could be totally containing the same content).

And then,I tried to set the insert stage to mod initalization phase. And first time I launch the game,It failed because the ClassnotDefExcetion,I guess that's because some .class files were overrided while running. But after this crash,every launching succeed and I just rerun it. So why it will always crash with ClassnotDefException at the first time but work peacefully after that and the mod just do what it did last time!!

Link to comment
Share on other sites

On 12/2/2022 at 10:19 PM, ChampionAsh5357 said:

Make a resource pack? Or make a mod. Don't try to modify an existing jar.

yep,what I meaned is I want to modify my mod jar itself while running.But that's truly kind of dangerous,maybe I would turn to modify the resource pack instead.

Link to comment
Share on other sites

  • 3 weeks later...

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.