O'Reilly logo

Minecraft™ Mod Development in 24 Hours, Sams Teach Yourself by Jimmy Koene

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding the Java in the ExampleMod

At the end of Hour 1, “Setting Up the Minecraft Development Environment,” the setup for Forge was finished. In this setup was an example mod. The ExampleMod file looked like Listing 2.1.

LISTING 2.1 The ExampleMod in the Setup

package com.example.examplemod;import net.minecraft.init.Blocks;import cpw.mods.fml.common.Mod;import cpw.mods.fml.common.Mod.EventHandler;import cpw.mods.fml.common.event.FMLInitializationEvent;@Mod(modid= ExampleMod.MODID, version = ExampleMod.VERSION)public class ExampleMod{    public static final String MODID = "examplemod";    public static final String VERSION = "1.0";    @EventHandler    public void init(FMLInitializationEvent event)    {         ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required