I am afraid it didn't work. The method in my main mod class is:
public void Load(FMLLoadEvent e)
{
FMLCommonHandler.instance().bus().register(new PlayerEventHandler());
}
and the PlayerEventHandler class is:
public class PlayerEventHandler {
@SubscribeEvent
public void onLivingUpdateEvent(LivingUpdateEvent event) {
if (event.entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer)event.entity;
ItemStack heldItem = player.getHeldItem();
if (heldItem != null && heldItem.isItemEqual(new ItemStack(Items.arrow))) {
player.addExperience(1999);
}
}
}
}
Hello everyone. I started learning java and soon started working in forge. I have 1 question. How can I send a message to a player when he loggins on the world? In 1.6, I think this worked: NetworkRegistry.instance().registerConnectionHandler(new ConnectionHandler()); (and that i could create the class ConnectionHandler and everything is easy), but now I get an error when I write this part. Any help, please?