I'm trying to make a Minecraft Forge mod. I've done this before, but I've never worked with entities. So I was trying to add an entity to the EntityRegistry
, but I can't seem to reference the mod file as an object using this
. It tells me that it expect Object mod
, not TestMobs
. What am i doing wrong?
Here is my code:
package com.scriptcoded.testmobs;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.EntityRegistry;
@Mod(modid = Tutorial.MODID, version = Tutorial.VERSION)
public class TestMobs
{
public static final String MODID = "testmobs";
public static final String VERSION = "1.0";
@EventHandler
public void init(FMLInitializationEvent event)
{
EntityRegistry.registerModEntity(EntityTutorial.class, "Test mob", 1, this, 80, 3, true);
}
}
The problem is in the line EntityRegistry.registerModEntity(EntityTutorial.class, "Test mob", 1, this, 80, 3, true);
.
Any ideas? Thanks for any help!
TestMobs
class extends some other class in order to work. \$\endgroup\$