This tutorial assumes you have already

Our mod currently doesn’t do anything. Lets change that and print something to the log!

To start off, make a public constructor with no arguments/parameters with nothing in it

Access levels
Access level modifiers determine whether other classes can reference a particular class, use a particular field, or invoke a particular method. Having our constructor be public allows Forge to call it and create our mod.

  • public Can be accessed by any class
  • protected Can only be accessed by its own class or subclasses
  • package-private (no explicit modifier) Can only be accessed by classes in the same package
  • private Can only be accessed in its own class

More info

Constructors
A class contains constructors that are invoked to create objects from the class blueprint. Constructor declarations look like method declarations—except that they use the name of the class and have no return type. More info

Now make a constant logger for your mod
public static final Logger LOGGER = LogManager.getLogger(MODID); (import the org.apache.logging.log4j logger not the java.util or org.apache.logging.log4j.core ones)
Then in your constructor call LOGGER.debug("Hello from YourModName!");
For eclipse people, you’ll need to refresh /src/
Now run your game again and you should be able to see “Hello from YourModName!” in your log
Log Your final code should look something like

package io.github.cadiboo.examplemod;

import net.minecraftforge.fml.common.Mod;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

@Mod(ExampleMod.MODID)
public final class ExampleMod {

	public static final String MODID = "examplemod";

	public static final Logger LOGGER = LogManager.getLogger(MODID);

	public ExampleMod() {
		LOGGER.debug("Hello from Example Mod!");
	}

}
1.4 - Proxies