fbpx
The article is also available in audio

 

In this Minecraft Modding tutorial, we will be providing you with step-by-step instructions on how to get started with Minecraft modding while creating an awesome custom Sword that you’ll get to play in the game.

 

We’ll be using Minecraft 26.1.2, running on the new NeoForge framework (version 26.1.2). We have created this special, updated guide to give you a taste of modern modding! NeoForge represents the cutting-edge of the Minecraft modding community, and diving into this version will show you how professional developers adapt to new technologies.

 

By following this guide, you will not only learn the fundamentals of Java programming, but you will also gain valuable experience with the latest tools used in the software industry today. Learning to move from older frameworks like Forge to modern ones like NeoForge builds problem-solving skills, resilience, and a deeper understanding of how games are built behind the scenes.

 

As a rule of thumb, Minecraft mod code is not compatible from version to version. For example, 26.1.2 mods will not work with 26.2 and above, and modern NeoForge code works quite differently from older Forge code.

 

You’ll need a PC or Mac computer for this tutorial, as Chromebooks or mobile devices will not run the software properly.

 

At CodaKid we have taught over 50,000 students Minecraft coding, and have won numerous industry awards for online courses including a Parents’ Choice Gold Award and CODiE Finalist for Best Coding and Computational Thinking Solution.

 

While we teach coding for kids, this guide can be used by teachers, parents, or anyone with an interest in creating a custom Sword Mod for Minecraft NeoForge.

 

We hope that you enjoy this free step by step guide to covering one of the first courses we teach in our Minecraft Modding series.

 

We’ll cover the very basics of what you’ll need to start Minecraft modding, and you will learn how to use Java, one of the most popular programming languages in the world.

 

We’ll also teach you how to download and use the Eclipse IDE, a text editor used by professional developers at companies such as Facebook, Google, and Amazon.

 

We will continue to update this blog in the coming months and transition to more recent versions of Minecraft as they become stable for mod creation. Our next big course revision will take place after the upcoming major Minecraft update.

What You’ll Learn

 

By completing this Minecraft modding tutorial, you’ll practice:

 

  • Java programming fundamentals
  • Variables, loops, and methods
  • Classes and objects
  • Object-oriented programming
  • Working with the Eclipse IDE
  • Creating custom Minecraft items
  • Debugging and testing Java code
  • Building and loading a Minecraft Forge mod

 

Beginner-Friendly Minecraft Modding Tools

 

If you’re completely new to programming, you don’t necessarily have to start by writing Java code. MCreator provides a visual way to create Minecraft mods and can help beginners understand concepts such as variables, conditions, and procedures before moving into text-based Java programming.

 

For custom artwork and models, Pinta can be used for 2D textures, while Blockbench is useful for creating custom 3D Minecraft models and textures.

 

This guide focuses specifically on Java-based modding with Minecraft Forge, but these tools can be useful as you progress from beginner projects to more advanced Minecraft creations.

 

Why Minecraft Is a Great Way to Learn Java

 

One of the benefits of learning Java through Minecraft modding is the immediate feedback. Instead of writing code and only seeing a result in a text window, you can place your creation directly into Minecraft and see how it works.

 

This connects programming with creativity and game design. As you build custom items and features, you’ll also practice problem-solving and debugging—identifying what went wrong, planning a solution, testing your changes, and improving your code when something doesn’t work as expected.

 

Step 1: Set up Java Developer Kit (JDK)

 

We will need to download the Java Developer Kit that will let our Minecraft Modding in Eclipse work correctly.

 

You can find the download link HERE for JDK 25. The version of JDK you need is JDK 25 to work properly with Minecraft Modding.

 

On the website, you’ll find several versions of JDK 25. For this tutorial, we’ll be utilizing version 25.0.3+9 or the most recent release. As shown in the image below, I’m selecting the Windows(x64) “.msi” version for download. However, versions of the JDK are also available for other platforms, allowing you to download the version that suits your system’s requirements best.

 

 

The download will start as soon as you click on the “.msi” download button. After downloading, you will find the executable file in your download folder.

 

 

Run the executable file to install the JDK.

 

Please follow the instructions provided in the pop-up window to install the JDK on your computer. Click on the “Next” button at each step, keeping the default settings unchanged, until the JDK installation is complete.

 

 

 

 

 

 

Now that the JDK installation is complete, we can proceed to set up our code editor in the next step.

 

Step 2: Set up your Text Editor

 

Before we begin Minecraft modding, we’ll need to download some tools.

 

First, for this guide, we will download the Eclipse IDE, which is one of the most popular professional text editors for Java worldwide.

 

To download the installer, please click on the following link: Eclipse Downloads | The Eclipse Foundation Look for the “Get Eclipse IDE 2026 Download” section that resembles the following image:

 

 

Click on the “Download x86_64” button, and the next page will appear where you can initiate the download. Click on the “Download” button displayed on that page and wait for the Eclipse file to finish downloading.

 

 

Locate the executable file in your downloads folder and open it to launch the Eclipse installer.

 

 

Once the launcher opens, please select the “Eclipse IDE for Java Developers” option.

 

 

On the next window, please keep the default installation location and then click the “INSTALL” button.

 

 

The next window will appear, where you will need to accept the agreement for Eclipse. Please read the agreement and then click on the “Accept” button to proceed.

 

 

After completing the above step, the installation process will begin.

 

 

After a successful installation, click on the “Launch” button to start the Eclipse IDE.

 

 

Once this process is completed, Eclipse will be downloaded and ready for use when we need to write our code.

 

The next step is setting up NeoForge, which lets our mod run inside Minecraft.

 

Step 3: Set up NeoForge

 

Next, you’ll need to download NeoForge for Minecraft 26.1.2. NeoForge is the modding platform we will use to build and load our mods (it is the modern, community-run successor to Forge). The steps shown here should also work for newer versions of NeoForge and Minecraft.

 

You can locate the download link HERE, and then simply adhere to the instructions we’ve outlined below.

 

On this page, scroll down to the “NeoForge installer files” section. Select 26.1.2 as the Minecraft Version and 26.1.2.78 as the NeoForge Version, then click the “Click Here to Download Installer” button, as depicted.

 

 

Once the download is finished, you will have the NeoForge installer. It is a Java (.jar) file, so it runs using the JDK we installed in Step 1.

 

Note: If the installer does not open when you double-click it, make sure JDK 25 from Step 1 is installed, then right-click the file and choose “Open with” > “Java(TM) Platform SE binary”.

 

Locate the “neoforge-26.1.2.78-installer.jar” file in your downloads folder and double-click on it to run the installer.

 

 

The NeoForge Installer window will open. Keep “Install client” selected and leave the default .minecraft folder location, then click the “Proceed” button. When the installation is complete, click “OK”. This adds NeoForge to your Minecraft Launcher so you can play with your mods later.

 

 

Next, we need a starter project for our mod, called the MDK (Mod Development Kit). NeoForge builds one for us with its Mod Generator, which you can find HERE. Fill in the form as shown below: enter “Example Mod” as the Mod Name (the Mod ID “examplemod” and the Package Name “com.example.examplemod” are filled in for you), choose 26.1.2 as the Minecraft Version, keep “ModDevGradle” as the Gradle Plugin, and then click the “DOWNLOAD MOD PROJECT” button.

 

 

Your browser will download a zipped folder named “examplemod-template-26.1.2.zip”. Locate it in your downloads folder.

 

 

Right-click on the zipped folder, select “Extract All…”, and then click the “Extract” button. The extracted folder will be our project folder, so we want to create a copy, rename it, and move it to a new location on our computer. We suggest making a copy in either your Documents folder or on your Desktop.

 

Right-click on the unzipped “examplemod-template-26.1.2” folder, select “Copy,” and then navigate to the desired location where you want to place it. Right-click in the location and select “Paste.” Ensure that you give it a descriptive name.

 

In this example, we will name it “ForgePractice.” 

 

We have successfully set up NeoForge and our project folder, and now we are ready to create our new project!

 

Step 4: Install Pinta

 

Next, we will proceed with installing the Pinta program, which we will use to modify the look of our Sword Texture.

 

To download Pinta, please follow this link: HERE and you will be directed to the Pinta download page.

 

On this page, click on the download link corresponding to your operating system, whether it’s Mac or Windows.

 

 

Once you have downloaded the installer, open it from your downloads folder and run the installer.

 

Proceed with the installation process, ensuring that you fully install the application and accept any agreements presented along the way.

 

 

 

 

 

 

Now that we have the necessary programs, we are ready to create our mod project.

 

The next step involves creating our project.

 

Step 5: Create Your Project

 

To begin, launch Eclipse. It will prompt you to choose a directory to use as Eclipse’s workspace. It’s important to note that this directory should be located outside of your project folder.

 

I recommend creating a folder named “eclipse-workspace” within your Documents folder. However, you can also choose to use the default location provided by Eclipse.

 

 

Eclipse will now open. Please close the Welcome tab by clicking on the close button (usually an “X” or a tab close button) located on the Welcome tab itself.

 

 

In the Package Explorer, click on “Import projects…”

 

 

In the “Import” window that pops up, select “Existing Gradle Project” and click Next.

 

 

 

On the next page, click “Browse…” and select your project folder. Click “Select Folder”.

 

 

 

You should now see this. Click Finish. It should close after importing the project. The first import can take several minutes, because NeoForge downloads Minecraft and sets everything up for you.

 

 

 

You should now see your default workspace view:

 

 

Go into the Gradle Tasks tab at the bottom of the window. With NeoForge, the Minecraft launch configuration is set up for us automatically, so there is nothing extra to set up. Expand the “mod development” task folder, and double-click on “runClient” to launch Minecraft.

 

 

Wait for the process to complete. The first launch can take a few minutes. It will open the Minecraft window; you just need to close it after it has loaded and proceed further.

 

From now on, you can run the game just by clicking the green “Run” button in the toolbar near the top of Eclipse, because Eclipse remembers “ForgePractice – runClient” as your last launch.

 

We are now ready to start Creating a Mod and learning Java!

 

Step 6: Make Your Own Mod – A Custom Sword!

 

Finally our Minecraft modding tutorial begins!

 

Once Eclipse is loaded up and opened, we are ready to start typing in java code.

 

Let’s open an example Mod java file that is provided for us that we will be starting from.

 

On the left side of the window, open the project folder by clicking the arrow next to the name. Your project folder will likely be named with the same name you gave to the folder in Documents.

 

Now open the “src/main/java” folder and then open the “com.example.examplemod” file and inside you will find ExampleMod.java.

 

Double click this to open up this java code file.

 

This file already contains starting code that NeoForge created for us with the Mod Generator. Unlike older versions of Forge, we will not delete it. Instead, we will look at the most important parts, and then add our own sword code in a few small places.

 

Understanding the starting code

 

@Mod(ExampleMod.MODID): This line serves as your mod’s name tag. It tells NeoForge that this class is a mod, and ExampleMod.MODID is your mod’s unique ID.

 

public static final String MODID = “examplemod”;: This is your mod’s unique ID. It must be all lowercase, and it matches the mod_id in the gradle.properties file. Minecraft uses it to tell your items apart from the items in other mods. For example, our sword will be known as examplemod:my_sword.

 

Each of these lines starts with public static final. public means other classes can use it, static means there is only one of it for the whole mod, and final means it will never change once it is set.

 

public static final Logger LOGGER = LogUtils.getLogger();: This line creates a LOGGER, which acts as a personal messenger for your mod. It writes messages, like “HELLO FROM COMMON SETUP”, to the Console tab in Eclipse while the game is running, so you can see what your mod is doing.

 

public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(MODID);: Think of this as a sign-up sheet for new items. Every item we put on this list gets added to Minecraft at the right moment while the game is loading. The template creates similar sign-up sheets for blocks (BLOCKS) and creative tabs (CREATIVE_MODE_TABS).

 

The template also adds an example block, an example food item and an example creative tab. You can leave them as they are. They are good examples of other things you can make later!

 

public ExampleMod(IEventBus modEventBus, ModContainer modContainer): This is the constructor, a special function that has the same name as the class. NeoForge runs it first, as soon as your mod is loaded. Inside it, lines like ITEMS.register(modEventBus); hand our sign-up sheets to NeoForge, so everything on them gets added to the game.

 

Step 6.1: Declare a variable for our sword

 

Now let’s add our sword! First, we need a place to keep it. Find the code that creates EXAMPLE_TAB. Just below it, before the constructor, add these lines:

 

//*********** DECLARE VARIABLES ******************
public static DeferredItem<CustomSword> mySword;

 

 

Lines that start with // are comments. Java ignores them; they are notes for us to keep our code organized.

 

public static DeferredItem<CustomSword> mySword;: We’re telling the computer to make a variable called mySword. A variable is like a labeled box that stores something. DeferredItem<CustomSword> is the type of the box: it will hold our CustomSword once NeoForge has added it to the game.

 

Step 6.2: Create the CustomSword class

 

You will notice a red line under CustomSword, because that class doesn’t exist yet. Place your mouse over the word CustomSword and choose Create class ‘CustomSword’ from the list of quick fixes.

 

 

A new window will open up. Keep these values at the default settings and just click Finish.

 

 

This will create a new Java code file called CustomSword.java and automatically open it. You can also see it in the Package Explorer, next to ExampleMod.java. A class is code that defines what something is and how it behaves, like a blueprint.

 

 

Now let’s build our sword, one line at a time.

 

Make our sword an Item

 

Click just after public class CustomSword and type extends Item, so that the line looks like this:

 

public class CustomSword extends Item {

 

 

extends: This keyword lets one class get all the features and behavior of another class. This is called inheritance. Our CustomSword gets everything a regular Minecraft item can do, and then we add our own stats. (Older versions of Minecraft had a SwordItem class with tiers like Tiers.DIAMOND. In Minecraft 26.1.2, we describe our sword’s stats ourselves instead.)

 

Item has a red line under it. Place your mouse over the word Item and choose Import ‘Item’ (net.minecraft.world.item). Eclipse adds the line import net.minecraft.world.item.Item; at the top of the file.

 

 

Add the constructor

 

Inside the curly brackets of the class, add the constructor:

 

public CustomSword(Item.Properties properties) {
     super(properties);
}

 

 

public CustomSword(Item.Properties properties): This is the constructor for our CustomSword, just like the one in ExampleMod. NeoForge passes in properties, which is a list of settings for the item, and we can add our own settings to it.

 

super(properties);: super means we want to use the code from the Item class we are extending. We hand it the properties, so Minecraft builds our item with those settings.

 

Give the sword durability and attack damage

 

Now we’ll give our sword its stats. Click just after the word properties inside super( and add the new lines, so that the super part looks like this:

 

     super(properties
                .durability(1561) // 1561 is Diamond tier durability
                .attributes(ItemAttributeModifiers.builder()
                     .add(
                            Attributes.ATTACK_DAMAGE,
                            new AttributeModifier(Item.BASE_ATTACK_DAMAGE_ID, 7.0, AttributeModifier.Operation.ADD_VALUE),
                            EquipmentSlotGroup.MAINHAND
                     )
                        .build()
             )
     );

 

 

.durability(1561): This is how many times the sword can be used before it breaks. 1561 is the same as a diamond sword.

 

.attributes(ItemAttributeModifiers.builder() … .build()): Attributes are the stats of our sword. The builder is like an order form: we add each stat we want with .add(…), and .build() finishes the form.

 

.add(…): Each stat needs three things. Attributes.ATTACK_DAMAGE is which stat we change. new AttributeModifier(Item.BASE_ATTACK_DAMAGE_ID, 7.0, AttributeModifier.Operation.ADD_VALUE) says how much: add 7.0 to the attack damage. EquipmentSlotGroup.MAINHAND says when: only while the sword is held in the main hand.

 

Several words now have red lines, because Eclipse doesn’t know them yet. Instead of fixing them one at a time, press Ctrl + Shift + O (Cmd + Shift + O on a Mac) to organize the imports. Eclipse will ask which Attributes we mean. Choose net.minecraft.world.entity.ai.attributes.Attributes and click Finish.

 

 

Add attack speed

 

Our sword hits hard; now let’s make it fast too. Add a second .add(…) just before .build():

 

                     .add(
                            Attributes.ATTACK_SPEED,
                            new AttributeModifier(Item.BASE_ATTACK_SPEED_ID, 2.0, AttributeModifier.Operation.ADD_VALUE),
                            EquipmentSlotGroup.MAINHAND
                     )

 

Your finished CustomSword.java should look like this:

 

 

Attributes.ATTACK_SPEED: This adds 2.0 to how fast you can swing the sword. In the game, the sword will show 8 Attack Damage and 6 Attack Speed, because a player already starts with 1 attack damage and 4 attack speed. You can change these numbers later to make your sword even more powerful!

 

Step 6.3: Register the sword

 

It’s finally time to add our CustomSword to the Minecraft world. Go back to ExampleMod.java and find the constructor (public ExampleMod(…)). Add these lines at the very top of it, right after the opening { bracket:

 

     //*********** INITIALIZE VARIABLES ******************
     // ****************** REGISTER ITEMS ******************
     mySword = ITEMS.registerItem(“my_sword”, CustomSword::new);

 

 

mySword = : Whenever you see “variable name = “, we’re telling the computer what to put inside that variable.

 

ITEMS.registerItem(“my_sword”, CustomSword::new): This adds our sword to the ITEMS sign-up sheet. “my_sword” is the registry name, the ID Minecraft uses for our item. CustomSword::new tells NeoForge how to build our sword: by calling the CustomSword constructor we just wrote.

 

Note: Make sure the registry name is in all lowercase letters. This isn’t the name of the sword you’ll see in the game; we’ll customize that later. Also, this line must come before ITEMS.register(modEventBus);, which is why we put it at the top of the constructor.

 

Step 6.4: Add the sword to a creative tab

 

Next, we’ll say which creative mode tab we want our CustomSword to be in. In creative mode you can see every item in the game. Scroll down to the addCreative method near the bottom of ExampleMod.java. It already adds the example block to the Building Blocks tab. Add our sword to the Combat tab by adding a second if block:

 

     if (event.getTabKey() == CreativeModeTabs.COMBAT) {
            event.accept(mySword);
     }

 

 

if (event.getTabKey() == CreativeModeTabs.COMBAT): addCreative runs once for every creative tab while the game is building them. This line checks whether the tab being built is the Combat tab. If you type CreativeModeTabs. (with the period), Eclipse will show you a list of the other tabs you can choose from.

 

event.accept(mySword);: This puts our sword into that tab.

 

Save both files by pressing Ctrl + S (Cmd + S on a Mac). Your mod is almost ready to shine. Congratulations on coming so far!

 

Now we can test out our “sword”, except it will not look like a sword just yet.

 

In order to test out our code, click the small arrow next to the green Run button in the toolbar and choose ForgePractice – runClient. After the first time, you can simply click the green Run button once.

 

 

After some time, you should see a window start opening Minecraft with NeoForge. Wait until it fully loads Minecraft to its main menu, then select Singleplayer.

 

 

Next, select Create New World. Change the Game Mode to Creative, change the world name if you like, and then click Create New World.

 

 

This will open the new world and take a bit of time to load.

 

Once the world is opened, press the E key to open the Creative inventory. Go to the Combat tab, or whatever tab you picked in our code, and scroll to the bottom of the tab to find your sword. You can also find it on the search tab, as in the image below.

 

We will be updating the look and the name, but if you put it in your inventory, you will have a sword that will function as we coded it to!

 

Note: The sword will look like purple and black boxes, because we haven’t created the texture and model files for our sword yet. Also, we will give our sword a customized name in the next steps.

 

 

Once you are done testing your purple and black block sword, let’s go back to our project.

 

Now we need to name our sword.

NeoForge’s template already created the language file for us. In the Package Explorer, open src/main/resources, then the assets/examplemod/lang folder, and double-click en_us.json to open it.

 

This file lists the names that players see in the game. Add a comma at the end of the last line, then add our sword’s name on a new line below it, so the end of the file looks like this:

 

  “examplemod.configuration.magicNumber”: “Magic Number”,
  “item.examplemod.my_sword”: “The Punisher”
}

 

 

“item.examplemod.my_sword” is our sword’s ID: examplemod is our MODID and my_sword is the registry name we chose. The text after the colon (:) is the name players will see. You can customize it to anything you like! Make sure every line except the last one ends with a comma, and save the file.

 

If you run the game again now, your sword already shows its new name, The Punisher. It still looks like purple and black boxes, because we haven’t made its texture and model yet.

 

 

Now we need to make our sword texture and import it into our project.

 

Right click on src/main/resources, choose New > Folder, select assets/examplemod as the parent folder, type textures/item as the folder name, and click Finish. Note: the folder name is item, not items.

 

 

I have attached a picture of an Iron Sword in Minecraft below.

 

Go ahead and right-click on it and select “Save image as…” then save the file as “my_sword.png”.

 

It is a small file because Minecraft needs a smaller image.

 

  

Once you have it saved, right-click on the picture wherever it is saved on your computer and then copy it.

 

Go to our project folder ForgePractice and open the src > main > resources > assets > examplemod > textures > item folder and paste in the my_sword.png into here.

 

 

Back in Eclipse, click on src/main/resources and press F5 to refresh. You will now see my_sword.png in the textures.item folder:

 

 

Now it’s time to customize our sword.

 

Open Pinta by searching for Pinta in our search bar and opening the Pinta program.

 

 

With Pinta opened, go to File > Open where a new window will open up.

 

 

Let’s now find our sword image in our project folder ForgePractice > src > main > resources > assets > examplemod > textures > item

 

 

Now we need to actually paint the sword!

 

Zoom all the way in, turn anti aliasing to the off position and change the brush width to 1. All of these settings are highlighted in the image below.

 

Now all you need to do is paint your sword and erase or add anything you want.

 

Use the colors, the brush, and the eraser tool.

 

Make sure to change your eraser anti aliasing and brush width as needed, just like we did with the paint brush.

 

Then paint your sword to look like whatever you want! If you make a mistake, you can hold down CTRL and then press down on Z to undo the changes. On a Mac, you’ll hold down the Command button and press down on Z.

 

 

 

Once you are done, go to File > Save and make sure the new changes are saved you made.

 

 

 

Now we need to tell Minecraft how to draw our sword. In Minecraft 26.1.2 this takes two small JSON files.

 

First, right click on src/main/resources and choose New > Folder.

 

 

Select the assets/examplemod folder as the parent folder, type models/item as the folder name, and click Finish.

 

 

Now right click on the new assets.examplemod.models.item folder and choose New > File.

 

 

Name the file my_sword.json and click Finish.

 

 

Type in this code:

 

{
“parent”: “item/handheld”,
“textures”: {
     “layer0”: “examplemod:item/my_sword”
}
}

 

 

“parent”: “item/handheld” makes Minecraft hold our item like a tool or a sword. “layer0” points to our texture: examplemod:item/my_sword means the file assets/examplemod/textures/item/my_sword.png.

 

Second, we make the items folder the same way. Right click on src/main/resources, choose New > Folder, select assets/examplemod as the parent folder, type items as the folder name, and click Finish.

 

 

Right click on the new items folder, choose New > File, name the file my_sword.json and click Finish.

 

 

Type in this code:

 

{
  “model”: {
“type”: “minecraft:model”,
“model”: “examplemod:item/my_sword”
  }
}

 

This file is new in recent versions of Minecraft. It tells the game which model to use for our my_sword item. Without it, the sword shows up as a purple and black box even if the texture is correct.

 

When you are done, your assets/examplemod folder should contain these files:

 

assets/examplemod/
items/my_sword.json
lang/en_us.json
models/item/my_sword.json
    textures/item/my_sword.png

 

Once this is all finished we are done with our custom Sword mod!

 

You can now test it by clicking on the Green play button just like what we did earlier!

 

Open the Combat tab again. Your sword now has its texture and its name! Hover over it to see its stats: 8 Attack Damage and 6 Attack Speed.

 

 

Put it in your hand and try it out!

 

 

Make sure everything is perfect and as you want it and then get ready to Compile your Mod and test it in Minecraft.

 

Step 7: Compile your Mod

 

Now that our code is finished, we need to compile and build our mod.

 

In order to build it, we need to go to the project folder we made, right click in an open space and select “Open in Terminal”. (On older versions of Windows, Shift + right click and select “Open PowerShell window here”.)

 

 

Once the window is open, write in the command “./gradlew build” and press Enter to run this command. The first build can take a minute. When it is done, you should see BUILD SUCCESSFUL.

 

Once this build is finished, return to your project folder ForgePractice and open the build and then the libs folder.

 

Make sure you see examplemod-1.0.0.jar.

 

This is our built mod file!

 

In the next step, we will show you how to load your Mod onto your Minecraft game.

 

 

Step 8: Test your Mod!

 

Now to test our mod, we need the regular Minecraft game with NeoForge installed. We already did this in Step 3 with the NeoForge installer, so there is nothing new to download. (If you skipped that part, go back to Step 3 and run the installer with “Install client” selected.)

 

Now we need to find our built mod file in our project folder.

 

Open your ForgePractice folder.

 

Then open the build folder and find the libs folder in here.

 

This is where our Mod will be.

 

Right click on examplemod-1.0.0.jar and choose Rename to give it any name you like. We named ours CodaKidSword.

 

 

Once it is renamed, go ahead and right click and copy the new jar file.

 

Once the jar file is copied, we need to open the folder that has our mods in it.

 

Go to the search bar and type %appdata% and open the folder that shows up in the search.

 

 

When this folder is open, open the .minecraft folder.

 

 

Inside this .minecraft folder, open the mods folder. If you don’t see one yet, create a new folder named mods.

 

 

Next, paste in your mod we copied earlier.

 

 

Your mod is all set up to work in Minecraft!

 

Now we need to launch Minecraft and open the NeoForge version. Search for and open the Minecraft Launcher.

 

 

This has to be Minecraft: Java Edition, and you need to be signed in with a Microsoft account that owns it.

 

The Bedrock (Windows) or mobile versions of Minecraft will not work.

 

 

Once the Minecraft Launcher is opened, select Minecraft: Java Edition and go to the Installations tab. There you will see the NeoForge installation (neoforge-26.1.2.78) that we installed in Step 3.

 

Click Play next to it to launch the NeoForge version of Minecraft.

 

 

Because this installation has mods, the launcher shows a warning. Check “I understand the risks. Don’t warn me again about this installation.” and click Play.

 

 

Once Minecraft is loaded, look at the bottom left corner of the main menu. It should say NeoForge 26.1.2.78 (3 mods): Minecraft, NeoForge and our sword mod. Now we need to make a new world, just like we did when testing our sword.

 

Select Singleplayer, then click Create New World, just like we did earlier.

 

 

In the settings, change it to Creative Mode and change your World Name.

 

Once all of this is done, click the Create New World button and wait for the new Minecraft world to load.

 

 

Just like earlier, find your sword in the Creative Tab by clicking “e” on your keyboard, and then head to the tab you set your Sword to appear in.

 

Mine is the Combat tab and, as you can see, The Punisher is at the bottom of the list of items. Hover over it to see its stats, then grab it and try it out!

 

 

You’ve officially created your own Minecraft Mod from scratch and loaded it into your own Minecraft game!

 

Congratulations!

 

You can make another sword using the same techniques or even challenge yourself to create an Axe or other tool.

 

 

Conclusion

 

Congratulations on finishing the guide! You set up JDK 25, Eclipse and NeoForge 26.1.2.78, wrote your own Java class, registered a custom sword, gave it a name, a texture and a model, built it into a .jar file and played it in Minecraft: Java Edition.

 

These are the same steps professional mod developers use. Now you can keep experimenting: change your sword’s attack damage and speed, paint a new texture in Pinta, or use the same steps to make an axe, a pickaxe or a brand new item.

 

Remember that mods are made for one version of Minecraft. When a new version of Minecraft or NeoForge comes out, you may need to update your code before your mod works again, just like we updated this guide from Forge 1.18 to NeoForge.

 

If you enjoy Minecraft Modding and want to take your skills further, CodaKid has a series of courses that can teach you how to make your own custom creatures, biomes, dimensions, insane explosions, special effects and more!

 

Our courses even include messaging and screen share support from live engineers if you ever get stuck, and our courses even come with a two-week free trial!

 

We hope you enjoyed The Ultimate Guide to Minecraft Modding with Java. If you enjoyed our Minecraft modding tutorial, we’d love it if you could share it with friends.

 

If you have any questions or comments, please leave them below!

 

Happy Minecraft Modding!

FAQs About Minecraft Modding With Java

1. What age can kids start Minecraft modding?

 

Kids can start learning Minecraft modding at different ages depending on their reading, computer, and programming experience. Younger beginners may benefit from visual modding tools and guided instruction, while students who are ready for text-based programming can progress to Java and Minecraft Forge.

2. Does my child need coding experience to start Minecraft modding?

 

No. Beginners can start by learning basic programming concepts such as variables, conditionals, loops, and methods. Visual tools such as MCreator can also provide an introduction to modding before students move into text-based Java programming.

3. How can my child move from MCreator to Java mods?

 

MCreator can help beginners become familiar with programming concepts through visual tools. Once they understand concepts such as variables, loops, and conditionals, they can begin learning Java and use Minecraft Forge to create mods with text-based code.

4. How do I fix a Minecraft Forge mod that crashes?

 

First, check that your Minecraft, Forge, and JDK versions are compatible. Then review the crash report for errors and check for missing dependencies or conflicting mods. Make one change at a time and test the game again to help identify the cause of the problem.

 

Minecraft Modding course

Related Articles

 

 

Choose Your Learning Path
Award-winning online coding and game design classes. Try for free.