Minecraft modding is the process of modifying the Minecraft game to add new features, change existing features, or create entirely new gameplay experiences. This tutorial will guide you through the process of creating a simple mod for the Java Edition of Minecraft.

Before you start modding, there are a few things you'll need to do. First, you'll need to make sure you have the latest version of Minecraft installed. You'll also need to download and install the latest version of the Java Development Kit (JDK), which is a program that allows you to write and run Java code.

Once you have these programs installed, you're ready to start modding! The first step is to create a new folder on your computer where you will store your mod files. This folder can be named anything you want, but for the purposes of this tutorial, we'll call it "MyMod".

Next, you'll need to create a new file called "mod.info" inside the "MyMod" folder. This file will contain some basic information about your mod, such as its name and version number. Here's an example of what the "mod.info" file might look like:

name=My Mod version=1.0

Now it's time to write some code! Create a new file called "MyMod.java" inside the "MyMod" folder. This will be the main file for your mod, and it's where you'll write most of your code.

To start, you'll need to import some Java libraries that will allow you to access the Minecraft game. Add the following lines to the top of your "MyMod.java" file:

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

Next, you'll need to define a class for your mod. This is the main container for your code, and it's where you'll define all of the features and behavior of your mod. Add the following lines to your "MyMod.java" file:

@Mod("mymod")
public class MyMod
{
    public MyMod()
    {
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
    }

    private void setup(final FMLCommonSetupEvent event)
    {
        // TODO: Add mod setup code here
    }
}

Now you have the basic structure for your mod set up! Next, you'll need to add some code to actually do something. For this tutorial, we'll keep it simple and add a new block to the game.

First, you'll need to import some additional libraries that will allow you to define a new block and add it to the game. Add the following lines to the top of your "MyMod.java" file:

import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraftforge.common.ToolType; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.ObjectHolder;

Next, you'll need to define a new block class. To do this, add the following lines to your "MyMod.java" file, below the existing code:

To do this, add the following lines to your "MyMod.java" file, below the existing code:

@ObjectHolder("mymod:my_block")
public static Block MY_BLOCK;

public static Block createBlock()
{
    return new Block(Block.Properties.create(Material.ROCK)
        .hardnessAndResistance(3.0f, 3.0f)
        .harvestTool(ToolType.PICKAXE)
        .harvestLevel(1));
}

In the code above, we've defined a new static field called "MY_BLOCK" to hold our block. We've also defined a new static method called "createBlock()" that will be used to create an instance of our block.

Now we need to add some code to actually create an instance of our block and add it to the game. To do this, add the following lines to your "setup()" method, inside the "MyMod" class:

MY_BLOCK = createBlock(); 
event.getRegistry().register(MY_BLOCK);

This code will create an instance of our block using the "createBlock()" method, and then it will register the block with the game so that it can be used by players.

Finally, we need to add some code to handle the event that is fired when the game registers its blocks. To do this, add the following lines to your "MyMod" class, below the existing code:

@Mod.EventBusSubscriber(modid = "mymod", bus = Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents
{
    @SubscribeEvent
    public static void onBlocksRegistry(final RegistryEvent.Register<Block> event)
    {
        event.getRegistry().register(createBlock());
    }
}

This code defines a new nested class called "RegistryEvents" that will handle the block registration event. It contains a single method called "onBlocksRegistry()" that will be called when the event is fired. This method simply creates an instance of our block and registers it with the game.

And that's it! You've now created a simple Minecraft mod that adds a new block to the game. To test your mod, you'll need to compile it and then run Minecraft with the mod installed. This process can be a little bit complex but nothing we can't handle here at ELI5.

To compile your mod, you'll need to use a program called the "Java Compiler". This is a command-line tool that comes with the JDK, and it allows you to turn your Java code into a file that can be run by the computer.

To compile your mod, first open a command prompt or terminal window and navigate to the "MyMod" folder that you created earlier. Then, run the following command:

javac MyMod.java

This command will compile your "MyMod.java" file into a file called "MyMod.class". This file contains the instructions that the computer can execute when your mod is run.

Once your mod has been compiled, you'll need to create a file called "mod.jar" that contains your mod and all of the other files it needs to run. To do this, you'll need to use a program called a "Java Archive Tool". This is another command-line tool that comes with the JDK, and it allows you to package up multiple files into a single JAR file.

To create your "mod.jar" file, run the following command:

jar cf mod.jar *

This command will create a new "mod.jar" file in your "MyMod" folder. This file contains all of the files in your mod, including your compiled code, the "mod.info" file, and any other files that your mod needs.

Now that you have your "mod.jar" file, you're ready to run Minecraft with your mod installed. To do this, first start Minecraft and click on the "Mods" button in the main menu. This will open the "Mods" screen, where you can manage and install your mods.

Click on the "Install" button, and then select the "mod.jar" file that you created earlier. This will install your mod and add it to the list of installed mods. Once your mod is installed, you can click on the "Play" button to start Minecraft with your mod loaded.

When you start Minecraft, you should see your new block in the game. You can use it just like any other block, and you can even craft it into other items if you want.

Modding Minecraft is a fun and creative way to customize the game and add new features. By following this tutorial, you've learned the basics of modding and created your first mod. From here, you can continue to learn and experiment with more advanced modding techniques to create even more complex and interesting mods.