Jump to content

Recommended Posts

Posted (edited)

Today I'm going to start modding.
Wish me luck! :D

--Gotlyfe--

 

I will be editing this post and providing sources for the reasoning behind my actions in the spoilers.

 

Updates:

-Downloaded and installed Java version of Minecraft from https://minecraft.net/download/

-Downloaded and installed Minecraft forge(recommended version 1.12.2 - 14.23.3.2655) from https://files.minecraftforge.net/

-Ran once to test it was working properly

  Reveal hidden contents


-Removed all versions of Java from my computer
-Installed Java 8u171 from Oracle 8u171 Download

  Reveal hidden contents


-Downloaded Forge source distribution(mdk) from http://files.minecraftforge.net/ (same version as installed earlier)

-Extracted zip file into empty folder
-Copied build.gradle gradlew.bat gradlew and the gradle folder to a new folder for project

  Reveal hidden contents


-Installed Eclipse from https://www.eclipse.org/downloads/

  Reveal hidden contents

 

-Opened Command Prompt as administrator

-Navigated to project Folder
-ran gradlew -Dorg.gradle.jvmargs=-Xmx3000m setupDecompWorkspace eclipse to set up workspace, set up for eclipse and make sure it had enough RAM to complete
-Completed in 11 mins 23 seconds

  Reveal hidden contents

 

-Opened Eclipse and set workspace one level above project folder

-Added Project to package explorer by Import > General > Existing Projects into Workspace > Select Root Directory

  Reveal hidden contents

 

-Altered Mod Information, changing build name, "maven coordinates", and version number under build.gradle

 

-Created new source folder for java, package inside source folder, project class inside package

-Created new source folder for resources

-Creating mcmod.info file in resources and fill with metadata about mod

  Reveal hidden contents

 

-Adding parts one by one to project class from ExampleMod.java

  Reveal hidden contents

 

-Adding

@Mod(modid = ClassName.MODID, name = ClassName.NAME, version = ClassName.VERSION)

 above public class ClassName which requires 


import net.minecraftforge.fml.common.Mod;
  Reveal hidden contents

 

-Adding public static final strings to project class definition for previously used metadata in @Mod 

  Reveal hidden contents

 

-Adding

private static Logger logger;

into class which requires

import org.apache.logging.log4j.Logger;
  Reveal hidden contents

 

-Creating initialization event functions

@EventHandler
    public void preInit(FMLPreInitializationEvent event)
    { 
  		logger = event.getModLog();
    }

@EventHandler
    public void init(FMLInitializationEvent event)
    { }

@EventHandler
    public void postInit(FMLPostInitializationEvent event)
    { }

which requires


import net.minecraftforge.fml.common.Mod.EventHandler;

to handle events at all and

import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;

to handle these specific events.

  Reveal hidden contents

 

  Reveal hidden contents

 

 

 

-Created build by using the cmd in the project folder directory to run gradlew build

-Copied the output file ([archivesBaseName]-[version].jar from build/libs into .minecraft\mods

  Reveal hidden contents

 

Success!

 

-- Will start a new thread specific to the kind of mod I am going to make it into. This seems to be a good general starting mod thread in my opinion.

Edited by Gotlyfe
  • Thanks 1
Posted

This is not by any chance a tutorial.

 

This is mostly copy-paste from the existing Forge docs intro (which is perfectly fine for people new to modding), and gave code which users can copy-paste into their files without learning anything, resulting in the same code as the example source. 

 

Also, the CommonProxy system doesn't make sense. Read Code Style, issue #1.

 

Your proxies shouldn't have code to distinguish the dedicated server from the integrated server. Almost all logic should be done on both servers, not just on one of them. That'll cause issues on the other server.

  • Sad 1

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted
  On 5/7/2018 at 9:06 PM, larsgerrits said:

This is not by any chance a tutorial.

 

This is mostly copy-paste from the existing Forge docs intro (which is perfectly fine for people new to modding), and gave code which users can copy-paste into their files without learning anything, resulting in the same code as the example source. 

Expand  

I think you really missed the point of this topic. Not trying to be a tutorial, that's why this isn't in the user-submitted-tutorials. It was a description of what I did and the places I went to, to figure out how to get the basics of a mod set up.

 

 

  52 minutes ago, larsgerrits said:

Also, the CommonProxy system doesn't make sense. Read Code Style, issue #1.

 

Your proxies shouldn't have code to distinguish the dedicated server from the integrated server. Almost all logic should be done on both servers, not just on one of them. That'll cause issues on the other server.

Expand  

Thanks, I'll re-work my code straight away.

  • 1 month 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.

Announcements



×
×
  • Create New...

Important Information

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