So, i normally code bukkit. getting into forge is a big change, 1 issue i am running into is how to register events (i've been looking for 2 hours)
classes ->
Main:
@Mod(modid = Styles.MOD_ID, name = Styles.MOD_NAME, version = Styles.VERSION)
public class Client {
@SidedProxy(clientSide = Styles.clientProxyClass, serverSide = Styles.serverProxyClass)
public static ServerProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent e) {
}
@EventHandler
public void init(FMLPreInitializationEvent e) {
}
@EventHandler
public void postInit(FMLPostInitializationEvent e) {
}
}
Event Class:
public class Knockback {
@SubscribeEvent
public void knockback(LivingAttackEvent e) {
if(e.entity instanceof EntityPlayer && e.source.getEntity() instanceof EntityPlayer) {
EntityPlayer target = (EntityPlayer) e.entity;
Vec3 look = e.source.getEntity().getLookVec().normalize();
double knockback = 0.5;
target.addVelocity(look.xCoord-knockback, look.yCoord-knockback, look.zCoord-knockback);
}
}
}
Server side: (Still a little confused here)
public class ServerProxy {
}
Client side: (once again, a little confused)
public class ClientProxy {
}
Help is much appreciated
(Yes i know, its a 1.8 build, however pointing me in the right direction would help)