Imagine a bacon-wrapped Ferrari. Still not better than our free technical reports.
See all our reports

Getting Started with Minecraft Modding by Aditya and Arun Gupta

The vJUG ran a special session on Minecraft Modding on Saturday 15th August. Why is it special? Well it’s the first session that’s been run on a Saturday, it’s the first session that’s being aimed at getting kids interested in technology, and it’s the first session that’s been given by a 12 year old! The Minecraft Modding session, heavily influenced by the great work Devoxx4Kids do, was delivered by Aditya Gupta and Arun Gupta. Yep, you guessed it, Aditya is Arun’s son!

The session was targeted at both parents and kids with the goal of getting kids interested in technology and software development. One of the most popular games among kids is Minecraft, which is developed in Java. Minecraft mods are changes to the game which can be coded up and injected into the main codebase. These changes can then be seen in the game while playing, making it an ideal and fun introduction to software development. Depending on how young and up to speed with computing your kids are will vary the amount of parental help they will need, but it’s worth being on standby just in case.

Here’s the full video of the session:

A big shout out to Matt Raible, a past speaker of the vJUG, for organising a Denver JUG session with a room full of kids with our live vJUG stream on the main screen! Great job Matt and team!

How do I get started?

Well, you should first go to, a site that has all the instructions and information you’ll need to get going. The next thing you need to do is download 3 components as described in the link, a JDK, IDE and Forge. In the example and the session, Aditya and Arun chose to use Eclipse, but you can of course use IntelliJ or NetBeans if you prefer so we avoid flamewars :)

Once you’ve downloaded and installed the three components described, you’ll need to go to the forge directory and run a gradle build command, which you can find in the minecraft modding link, which will generate your eclipse workspace for you to use. When you open Eclipse, make sure you point the workspace to the eclipse folder in the forge directory. You should now have your code available to play with in Eclipse. To run minecraft, simply click the big green run button :)

I wanna play!

Well, there are two ways you can play. You could just start minecraft and run about doing stuff. Or, and most interestingly, you can play in the codebase, which is a much more exciting place to explore! In the session, Aditya creates a new package and Class with code straight from the instructions in the minecraft modding page. Here’s the interesting piece of the code:

@Mod(modid = MainMod.MODID, version = MainMod.VERSION)
public class MainMod {
  public static final String MODID = "MyMods";
  public static final String VERSION = "1.0";

  public void init(FMLInitializationEvent event) {


The two parts which make this interesting is the @Mod annotation by the class declaration which makes the class a Minecraft mod and the @EventHandler annotation, which instructs the minecraft runtime to execute the init method upon initialization of the minecraft engine.

Aditya then creates a second class called ChatItems as shown:

public class ChatItems {

  public void giveItems(ServerChatEvent event){
    if (event.message.contains("potato")) {
      event.player.inventory.addItemStackToInventory(new ItemStack(Items.potato, 64));

This class has a @SubscribeEvent annotation on the giveItems method which executes when a chat event is triggered. This means that is someone types something during the game, the giveItems method will be driven with the message as part of the event object. In this implementation, Aditya checks to see if the text sent contains the string potato. If it does, the player’s inventory will have 64 potatoes added to it.

The final thing Aditya did was to connect the two classes that he just created. Remember, one is the actual mod itself, the other is simply a listener which the mod needs to register. Here’s the line Aditya added to the init method of his MainMod Class.

  MinecraftForge.EVENT_BUS.register(new ChatItems());

This line registers a listener for chat events. Next we need to build and restart our application to pick up our changes – tedious huh! If only JRebel could do that for us! Oh hang on, it can! But anyway, once we’ve restarted and type potato into the chat a couple of times, we can see we have more potatoes than a potato salad kickstarter!

Minecraft Modding potatoes

Aditya continues to show some other cool mods he’s worked on including the ability to spawn Ender Dragons, as shown below. All the code snippets are in the minecraft modding instructions, and this example is example 7.

Minecraft Modding Ender Dragons

My takeaways

First of all it was great to be involved with this, as this kind of initiative wasn’t available when I was growing up. In fact, as I mentioned in the session, I learnt C by myself from a book, and that was really exciting for me, so I can only imagine how much fun it is for a kid to play and change the world they play in with code today.

Also, it was really great listening from someone as passionate and smart as Aditya at such a young age. It was incredibly inspiring to see such raw talent and excitement around a technology and initiative.

Speaker Interview

As Oleg was unable to attend the session, I had the privilege to interview Aditya and Arun about why they’re so engaged with the Devoxx4Kids program, what makes them tick and of course whether they prefer kittens or puppies!

As usual, if you enjoyed this content and want more of the same, you should subscribe to our feed and we’ll send you the content as quick as we write it! Enter your email below to join our RebelLabs community.