Jump to content

Recommended Posts

Posted

This tutorial assumes you have some previous knowledge of Minecraft modding and have gotten all the initial stuff done (PATH variables whatnot).

Feel free to correct me. Check back once in a while for updates.

 

Contents

  • [iurl=#initial_setup]Initial Setup[/iurl]
  • [iurl=#advanced_setup]Advanced Setup[/iurl]
  • [iurl=#update_forge]Updating Forge[/iurl]
  • [iurl=#update_forgegradle]Updating ForgeGradle[/iurl]
  • [iurl=#compiling]Compiling/Obfuscating and Version Details[/iurl]
  • [iurl=#migrationbeta]Migrating to 1.8[/iurl]
  • [iurl=#migration]Migrating to 1.7[/iurl]
  • [iurl=#update_forgegradle]Updating ForgeGradle[/iurl]
  • [iurl=#troubleshoot]Troubleshooting Common Issues[/iurl]

 


 

[ANCHOR=initial_setup]Initial Setup[/ANCHOR]

First of all, make sure you have the latest version of Eclipse.

Download the latest version of the Forge source from the usual place and extract it somewhere.

 

Go inside the Forge folder.

Windows:

Use the cd command to navigate to the correct directory.

You can also hold shift, right click and click Open command window here to open it in the current directory.

Run the following in command prompt:

gradlew.bat setupDecompWorkspace
gradlew.bat eclipse

Mac OS X:

Use the cd command to navigate to the correct directory.

Run the following in terminal:

bash gradlew setupDecompWorkspace
bash gradlew eclipse

Linux:

Use the cd command to navigate to the correct directory.

Run the following in terminal:

./gradlew setupDecompWorkspace
./gradlew eclipse

You may need to run the following beforehand if the gradlew file is not executable:

chmod +x ./gradlew

 

Replace eclipse with idea if you are using IntelliJ IDEA.

 

If it is taking a long time to download assets, you can skip it by copying the assets folder from your normal minecraft folder to forge-directory/.gradle (so you will have forge-directory/.gradle/assets).

 

Now open up Eclipse and point the project directory to the eclipse folder. If this doesn't work for you, skip to the advanced setup.

You're done with the initial setup! You can now delete or study the example mod from src/main/java and the mcmod.info in src/main/resources. Replace it with your own mod.

 


 

[ANCHOR=advanced_setup]Advanced Initial Setup[/ANCHOR]

For those who cannot get the simple method to work.

See [iurl=#troubleshoot]the troubleshooting section[/iurl] before trying this method.

 

Open up Eclipse, but do not point the project directory to the eclipse folder.

Instead, select a new folder (not inside the extracted Forge folder) as your workspace.

 

Go to File > Import... and select General > Existing Projects into Workspace. Do not import a Gradle Project.

zTIswIM.png

Click Next and set the root directory as the root forge directory, not the eclipse directory within it.

Make sure the project is selected and click Finish.

 

You're not done yet! Go to Run > Run Configurations....

Right click Java Application and click New and you will see New_configuration under it.

Set the name to Run Client or something as descriptive. Do not name it Client, it will conflict with the one Forge has. Then, set the current project, and set the Main class as:

net.minecraft.launchwrapper.Launch

Go to the Arguments tab, and add the following under Program Arguments:

--version 1.6 --tweakClass cpw.mods.fml.common.launcher.FMLTweaker --accessToken FML --userProperties {}

And this under the VM Arguments:

-Dfml.ignoreInvalidMinecraftCertificates=true

Click Apply to save the configuration.

 

Now create another new configuration under Java Application and name it Run Server (or something similar). Do not name it Server, it will conflict with the one Forge has.

Again, set the current project, but set the main class to the following instead:

cpw.mods.fml.relauncher.ServerLaunchWrapper

Click Apply. No arguments are required for the server, though you may want to pass some yourself.

44sMzFo.png

 

 

 


 

[ANCHOR=update_forge]Updating Forge[/ANCHOR]

ForgeGradle allows you to update your dev environment to the latest version of Forge easily.

Open your build.gradle file. The following lines will interest you for this part:

minecraft {
    version = "1.7.2-10.12.2.1147"
    assetDir = "eclipse/assets"
}

Simply change the version field to the latest version of Forge, such as 1.7.10-10.13.0.1187. All versions are listed on the Forge download page.

minecraft {
    version = "1.7.10-10.13.0.1187"
    assetDir = "eclipse/assets"
}

Save the file, then navigate to your Forge directory. Run the setup command from the initial setup (setupDecompWorkspace and eclipse). Forge will update the necessary files.

If the process fails, you may also need to update ForgeGradle.

 


 

[ANCHOR=update_forgegradle]Updating ForgeGradle[/ANCHOR]

ForgeGradle is separate from Forge. Updating Forge alone will fail when updating between ForgeGradle versions.

These are the current versions of ForgeGradle and the versions of Forge they cover:

ForgeGradle

Forge Versions

-               

            959<, 965

1.0             

              960-964

1.1             

            967-1047

1.2             

                1048+

 

Delete your .gradle folder.

Then, open your build.gradle file. The following lines will interest you for this part:

    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT'
    }

Replace 1.1-SNAPSHOT with 1.2-SNAPSHOT.

 

Afterwards, go to the bottom of the file - this part can also be done on any previous version of ForgeGradle

processResources
{
    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
    ...

Append 3 lines to the beginning of processResources:

processResources
{
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
    ...

 

Save the file, then navigate to your Forge directory. Run the setup command from the initial setup (setupDecompWorkspace and eclipse). ForgeGradle will update the necessary files.

 


 

[ANCHOR=compiling]Compiling/Obfuscating and Version Details[/ANCHOR]

Open your build.gradle file. The following lines will interest you for this part:

version = "1.0"
group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"

Change the version field to the version of your mod. For usability purposes append the version of Minecraft as a prefix, such as 1.7.10-

Change the group field to your personal project group names. For example, Forge uses net.minecraftforge

Change the archivesBaseName field to your Mod ID, the same one as you put in your @Mod annotation.

Your build.gradle file should look a bit like this now:

version = "1.7.10-1.0"
group= "com.github.username" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "TestMod"

Alternatively, you can append a suffix of the Minecraft version to your archivesBaseName field instead of the version field.

 

Go inside the Forge folder and run the following in command prompt/terminal.

Windows:

gradlew.bat build

Mac OS X:

bash gradlew build

Linux:

./gradlew build

 

If this is not the first time you are building and ForgeGradle seems to ignore any changes you made to your build.gradle file, you need to run the following command beforehand.

Backup your src folder first as it may be deleted.

Windows:

gradlew.bat clean

Mac OS X:

bash gradlew clean

Linux:

./gradlew clean

 

Your mod will be packaged as a .jar file inside forge-directory/build/libs - in our example, it will be named TestMod-1.7.2-1.0.jar

For more complex setups requiring other mods as dependencies, visit the #ForgeGradle or #MinecraftForge channels on EsperNet.

 


 

[ANCHOR=migrationbeta]Migration to 1.8 - Currently in beta![/ANCHOR]

Here are some of the biggest changes for 1.8:

  • Imports should change from [TT]cpw.mods[/TT] to [TT]net.minecraftforge[/TT]. For example:
    [TT]import cpw.mods.fml.common.Mod;[/TT]
    should be changed to
    [TT]import net.minecraftforge.fml.common.Mod;[/TT]
  • New BlockState stuff currently in development, details coming Soon™.
  • More to come as Forge for 1.8 is developed...

 


 

[ANCHOR=migration]Migration from 1.6 to 1.7[/ANCHOR]

Here are some of the biggest changes for 1.7:

  • Mod metadata parsing has been overhauled and no longer supports the authors field. If you are still using it in your mcmod.info file, change it to authorList.
    Technically, authorList has been in FML since 1.5, but the wiki has not been updated to reflect this change.
  • Goodbye block and item IDs! Those are now handled internally for you!
    Consequently, functions such as getBlockID no longer exist and have been replaced with a non-ID equivalent (in this case, getBlock).
  • NetworkMod is gone. A more advanced networking library is available instead (Netty).
  • @ForgeSubscribe is now @SubscribeEvent
  • Interfaces are now events
  • Renamed packets
  • List of blocks are now in Blocks.class instead of Block.class
  • List of items are now in Items.class instead of Item.class

 


 

[ANCHOR=troubleshoot]Troubleshooting Common Issues[/ANCHOR]

No Audio: Unable to play unknown soundEvent

Add the following to your runtime arguments:

Windows

--assetIndex 1.7.10 --assetsDir %userprofile%\.gradle\caches\minecraft\assets

If %userprofile% does not resolve to its actual value, you will need to use the absolute path.

You can type it in Windows Explorer to resolve the directory.

For example, mine would be [TT]C:\Users\GrygrFlzr\.gradle\caches\minecraft\assets[/TT]

Linux/OS X

--assetIndex 1.7.10 --assetsDir ~/.gradle/caches/minecraft/assets

 

 

Crash: joptsimple.MissingRequiredOptionException: Missing required option(s) ['accessToken']

Add the following to your runtime arguments:

 --accessToken FML

 

 

Crash: joptsimple.MissingRequiredOptionException: Missing required option(s) ['userProperties']

Add the following to your runtime arguments:

 --userProperties {}

 

 

Crash: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

Right click the project (Minecraft) > Properties > Java Build Path > Libraries

Scroll down to find your version of lwjgl (eg. [TT]lwjgl-2.9.1.jar[/TT]), click the arrow beside it, and double click Native Library Location.

Locate your [TT]/build/natives[/TT] folder located in your workspace directory. For example, mine would be [TT]C:\Users\GrygrFlzr\Mods\GlowstoneWire\build\natives[/TT]

l1Hx5By.png

AeooTRh.png

qKI1cfY.png

 

You need to agree to the EULA in order to run the server. Go to eula.txt for more info.

Follow what it says. Go to forge-directory/eclipse, open eula.txt and change [TT]false[/TT] to [TT]true[/TT].

If the file does not exist, just create one named eula.txt, and put the following in it:

#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).
eula=true

 


 

[ANCHOR=credits]Thanks to:[/ANCHOR]

  • LexManos for the new

  • AbrarSyed for sort of explaining the process at 4AM when he should be sleeping, and giving pointers on ForgeGradle stuff
  • luacs1998 for pointing out Run Configuration arguments for previous versions of ForgeGradle
  • PaleoCrafter and SoniEx2 for mentioning authorList
  • A whole bunch of other people I forgot to mention

 

Visit the #ForgeGradle IRC channel on EsperNet for questions and discussion on ForgeGradle.

For a comprehensive list of mods, visit the MCF Modlist!

Posted

Thanks!

 

Now I need to make "one project per mod in the same workspace" work and modify the build.gradle file to work like I want it to and I'll be a happy camper. ;)

 

ItemBlock is not a Block

ItemStack is not an Item

Damage value is not metadata

 

Stop confusing them.

Posted
As of the time of writing, ForgeGradle does not yet support deobfuscating Minecraft, and so none of the usual Minecraft source files are there.

 

Are you sure of this? O.o

That seems quite absurd to me, seeing as this is the official way to build and use forge as of the latest builds.

I'm quite sure they wouldn't release it if it where in such a useless state...

If you guys dont get it.. then well ya.. try harder...

Posted

As of the time of writing, ForgeGradle does not yet support deobfuscating Minecraft, and so none of the usual Minecraft source files are there.

 

Are you sure of this? O.o

That seems quite absurd to me, seeing as this is the official way to build and use forge as of the latest builds.

I'm quite sure they wouldn't release it if it where in such a useless state...

The only mistake in that sentence (which luacs1998 has fixed) was saying deobfuscating instead of decompiling. At this point, ForgeGradle does not even decompile Minecraft, nor does it need to - you do not need access to Minecraft source code to run your mod.

For a comprehensive list of mods, visit the MCF Modlist!

Posted

They are working on an update where we can get a read-only access to the minecraft/forge source.

Lex mentioned it in the release post :)

If you guys dont get it.. then well ya.. try harder...

Posted

Gradle Integration for Eclipse 03.4.0.RELEASE. won't install in eclipse right.

The following solutions are not available: Gradle Intergration for Eclipse

Posted

I'm locking this thread, people are going off topic.

Could a kind soul who is more experienced with ForgeGradle (AbrarSyed u.u) please create a "Common Problems and Solutions" thread please?

Read the EAQ before posting! OR ELSE!

 

This isn't building better software, its trying to grab a place in the commit list of a highly visible github project.

 

www.forgeessentials.com

 

Don't PM me, I don't check this account unless I have to.

  • 4 months later...
  • 1 month later...
Posted

Just followed the instructions to create a workspace. Needed to do the advanced setup.

'Run Client' is not working good. Client crashes. I followed the instructions like in the initial setup

This is the Log:

[21:07:32] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[21:07:32] [main/INFO] [FML]: Forge Mod Loader version 7.2.172.1073 for Minecraft 1.7.2 loading
[21:07:32] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_25, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
[21:07:32] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[21:07:32] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:07:32] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[21:07:34] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/pieter/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.1.1073/forgeSrc-1.7.2-10.12.1.1073.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!
[21:07:34] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!
[21:07:34] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/pieter/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.1.1073/forgeSrc-1.7.2-10.12.1.1073.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it
[21:07:34] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[21:07:34] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:07:34] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
[21:07:35] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[21:07:37] [main/ERROR] [LaunchWrapper]: Unable to launch
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:1.7.0_25]
at java.lang.Runtime.loadLibrary0(Unknown Source) ~[?:1.7.0_25]
at java.lang.System.loadLibrary(Unknown Source) ~[?:1.7.0_25]
at org.lwjgl.Sys$1.run(Sys.java:73) ~[lwjgl-2.9.0.jar:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_25]
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.loadLibrary(Sys.java:95) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.<clinit>(Sys.java:112) ~[lwjgl-2.9.0.jar:?]
at net.minecraft.client.Minecraft.getSystemTime(Minecraft.java:2690) ~[Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:40) ~[Main.class:?]
... 6 more

Coding, Testing, Smiling, Publishing!

Posted

Is there anyway somebody can tell me where these files are being installed to, since the download always hangs, and I can just go in and download and put them in the right locations myself.

  • 3 weeks later...
Posted

For anyone moving from FG for 1.6.4 to 1.7.2, the sonatype maven entry needs to be added after the forge maven entry in the buildscript section at the top:

 

        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }

Posted

thank you for this; the advanced initial setup finally worked for me after battling all last night trying to get the "simple" version to work on my mac.  the only thing that's still going wrong is that i am not getting sound, but that's for another post; i think i saw something about that earlier.

 

something you might want to add to the tutorial, since we're now mostly modding 1.7:  in the arguments for the "run client" configuration, one needs to type

--version 1.7 --tweakClass cpw.mods.fml.common.launcher.FMLTweaker --accessToken Player1234

because 1.7 needs the access token, or the client will die.

Posted

One question, I followed all the steps using forge-1.6.4-9.11.1.964

 

It works, and Minecraft Launchs Ok. But my "src" folder is empty, it only has "main" and no net.minecraft files and folders showing.

 

Am I missing some step?

 

Thanks.

  • 3 weeks later...
Posted

Just followed the instructions to create a workspace. Needed to do the advanced setup.

'Run Client' is not working good. Client crashes. I followed the instructions like in the initial setup

This is the Log:

[21:07:32] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[21:07:32] [main/INFO] [FML]: Forge Mod Loader version 7.2.172.1073 for Minecraft 1.7.2 loading
[21:07:32] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_25, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
[21:07:32] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[21:07:32] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:07:32] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[21:07:34] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/pieter/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.1.1073/forgeSrc-1.7.2-10.12.1.1073.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!
[21:07:34] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!
[21:07:34] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/pieter/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.1.1073/forgeSrc-1.7.2-10.12.1.1073.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it
[21:07:34] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[21:07:34] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:07:34] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
[21:07:35] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[21:07:37] [main/ERROR] [LaunchWrapper]: Unable to launch
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:1.7.0_25]
at java.lang.Runtime.loadLibrary0(Unknown Source) ~[?:1.7.0_25]
at java.lang.System.loadLibrary(Unknown Source) ~[?:1.7.0_25]
at org.lwjgl.Sys$1.run(Sys.java:73) ~[lwjgl-2.9.0.jar:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_25]
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.loadLibrary(Sys.java:95) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.<clinit>(Sys.java:112) ~[lwjgl-2.9.0.jar:?]
at net.minecraft.client.Minecraft.getSystemTime(Minecraft.java:2690) ~[Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:40) ~[Main.class:?]
... 6 more

 

Did anybody ever find oyut how to fix this?

  • 4 weeks later...
Posted

Just followed the instructions to create a workspace. Needed to do the advanced setup.

'Run Client' is not working good. Client crashes. I followed the instructions like in the initial setup

This is the Log:

[21:07:32] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[21:07:32] [main/INFO] [FML]: Forge Mod Loader version 7.2.172.1073 for Minecraft 1.7.2 loading
[21:07:32] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_25, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
[21:07:32] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[21:07:32] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:32] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:07:32] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[21:07:34] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/pieter/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.1.1073/forgeSrc-1.7.2-10.12.1.1073.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!
[21:07:34] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!
[21:07:34] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/pieter/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.1.1073/forgeSrc-1.7.2-10.12.1.1073.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it
[21:07:34] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[21:07:34] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:07:34] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
[21:07:35] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[21:07:37] [main/ERROR] [LaunchWrapper]: Unable to launch
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:1.7.0_25]
at java.lang.Runtime.loadLibrary0(Unknown Source) ~[?:1.7.0_25]
at java.lang.System.loadLibrary(Unknown Source) ~[?:1.7.0_25]
at org.lwjgl.Sys$1.run(Sys.java:73) ~[lwjgl-2.9.0.jar:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_25]
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.loadLibrary(Sys.java:95) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.<clinit>(Sys.java:112) ~[lwjgl-2.9.0.jar:?]
at net.minecraft.client.Minecraft.getSystemTime(Minecraft.java:2690) ~[Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:40) ~[Main.class:?]
... 6 more

 

Did anybody ever find oyut how to fix this?

 

I've updated the thread to address [iurl=#troubleshoot]troubleshooting problems[/iurl].

For a comprehensive list of mods, visit the MCF Modlist!

  • 3 weeks later...
  • 2 months later...
Posted

Hey, i have following error:

 

Matthiass-Mini:forge-1.7.10-10.13.2.1230-src MatthiasReef$ bash gradlew setupDecompWorkspace
Exception in thread "main" java.io.FileNotFoundException: /Users/MatthiasReef/.gradle/wrapper/dists/gradle-2.0-bin/5h57m9vra0mjv9qs45oqtsb5c0/gradle-2.0-bin.zip.lck (Permission denied)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:49)
at org.gradle.wrapper.Install.createDist(Install.java:44)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)
Matthiass-Mini:forge-1.7.10-10.13.2.1230-src MatthiasReef$ bash gradlew eclipse
Exception in thread "main" java.io.FileNotFoundException: /Users/MatthiasReef/.gradle/wrapper/dists/gradle-2.0-bin/5h57m9vra0mjv9qs45oqtsb5c0/gradle-2.0-bin.zip.lck (Permission denied)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:49)
at org.gradle.wrapper.Install.createDist(Install.java:44)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)
Matthiass-Mini:forge-1.7.10-10.13.2.1230-src MatthiasReef$ 

 

In everyone help me?

  • 1 month later...
Posted

I got this Problem Please Help Me

 

 

 

Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached
waiting for exclusive access to file: C:\Users\Vergara\.gradle\wrapper\dists\gr
adle-2.0-bin\5h57m9vra0mjv9qs45oqtsb5c0\gradle-2.0-bin.zip
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:61)
        at org.gradle.wrapper.Install.createDist(Install.java:44)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)

  • 5 months later...
Posted

Hey, I've been trying to get this to work for over a week now, and I figured I should post and ask for some help.

 

What I'm trying to do is a little different than what this tutorial is for, in that I'm trying to contribute to a pre-existing mod, not create a new one. The mod in question is https://github.com/TechReborn/TechReborn, and while I got further using the "Advanced Initial Setup," I still can't get it working.

 

What I've done is download the TechReborn package from github, run gradle to update dependencies and such, and then tried to follow the other directions. Unfortunately I'm stuck with an error "Could not find or load main class net.minecraft.launchwrapper.Launch."

 

Is there some different process if I'm modifying an existing mod, instead of creating a new one?

  • 1 month later...
Posted

Hey guys, I've been having some problems trying to compile my mod. My mod is for version 1.7.10, and i tried compiling it using both "bash gradlew build" and "./gradlew build" (I use a mac). Both attempts failed due to this error:

 

* Where:

Build file '/Users/MinecraftModding/Desktop/SlayersToolbox/build.gradle' line: 21

 

* What went wrong:

Could not compile build file '/Users/MinecraftModding/Desktop/SlayersToolbox/build.gradle'.

> startup failed:

  build file '/Users/MinecraftModding/Desktop/SlayersToolbox/build.gradle': 21: expecting anything but ''\n''; got it anyway @ line 21, column 26.

    group= "com.slayer.main”

                              ^

 

  1 error

 

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
    • Do you use features of inventory profiles next (ipnext) or is there a change without it?
    • Remove rubidium - you are already using embeddium, which is a fork of rubidium
  • Topics

×
×
  • Create New...

Important Information

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