Jump to content

Complete Newbie, Followed Tutorial, How Do I Build a jar


Recommended Posts

Posted (edited)

I followed a tutorial to make a patch between two mods. I now have a folder that looks like this.
spacer.png

I have essentially zero experience writing mods, using Forge, or using Gradle, which I know is less than basically everyone here, but I don't know where else to go. All I want to do is package this into a .jar and add it to my game. How do I do that?

I have tried opening a command line and running 'gradlew build' in this folder, as suggested by this minecraft forums thread.  The build ran for a while and then failed. The output is here. The issues seem to be that it couldn't find 'tools.jar' and 'net.minecraftforge:forge:1.16.4-35.1.0_mapped_snapshot_20201028-1.16.3'.

 

What should I do? To be clear, at the moment I am less interested in making a larger project or learning general Forge skills than I am in solving this immediate problem. All I want to do right now is install this patch so I can start using these mods together. I would greatly appreciate clear and easy-to-follow steps. Thank you for the help.

Edited by Syric
Posted

Sorry about that, I know it's phrased badly. I do have a basic understanding of Java- just enough to do what little writing this project required. I'm not unwilling to learn, I'm just prioritizing immediately actionable advice over general skills. I said it because I've spent the last couple hours reading tutorials about general Forge modding skills and I just really, really need a list of steps to follow at this point.

Posted (edited)

Okay, I've put some time into it and I now have things running okay (I think)- I have JDK 8, and I'm using Intellij IDEA. My mod builds successfully. I have been told that the output .jar file is in build/libs, but the libs folder doesn't exist. My build folder looks like this. Have I done something wrong? 

image.png

 

I set up a jar artifact and compiled successfully, but it crashes the game on startup. This is the log file:

image.thumb.png.97805cae2d9d6445868910c07f38b04d.pngI suspect that it did not, in fact, compile successfully. My guess is that I set up the artifact wrong. What should I do?

Edited by Syric
Posted (edited)

My mod now runs and functions perfectly when I launch Minecraft using 'gradlew runClient', which that link suggested for testing. However, when I take the jar I made with 'gradlew build' and put it in my Forge mods folder, Minecraft does not launch- I get this error instead.
2020-12-30_23_09_06.thumb.png.b4e0506392932801ae80df126d17e5f5.png
For reference, my mod is 'Undergarden/Tetra Patch' and 'tetra' is one of the mods I'm attempting to work with.

 

Full crash log available here.

If anyone knows how to fix this error specifically, that's great, but the question I think would be easier to answer is 'why does this work with gradlew runClient but not in normal Minecraft'?

 

Thanks for your help. 

Edited by Syric
Posted

When you tried to run your mod outside of development did you also remember to add the mod you're using into the mod folder?

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

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.

Announcements



×
×
  • Create New...

Important Information

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