I have made an event handling class, and have registered it using the following:
public class EventManager
{
@EventHandler
public void load(FMLInitializationEvent event)
{
FMLCommonHandler.instance().bus().register(new EventManager());
}
@SubscribeEvent
public void onEntitySpawn(EntityJoinWorldEvent event)
{
MineAILog.log.info("Entity Has Spawned");
if (event.entity instanceof EntityMob)
{
MineAILog.log.info("Entity is a mob");
assignAI((EntityMob) event.entity, event);
}
}
private void assignAI(EntityMob e, Event ev)
{
e.tasks.addTask(4, new EntityAIAttackOnCollide(e, EntityAI.class, 1.0D, false));
e.targetTasks.addTask(4, new EntityAINearestAttackableTarget(e, EntityAI.class, 0, true));
}
}
And yet the event does not fire at all, and the log functions do not run. I have also tried registering the EventManager class in the main mod class, but this has not worked either. I honestly do not know why it is not firing.