So I'm trying to make the player get 2 apples when joining a world (for testing purposes) but I cant seem to get it to work. here's my code:
@SubscribeEvent
public static void init(FMLInitializationEvent event)
{
MinecraftForge.EVENT_BUS.register(EventHandler.class);
}
@SubscribeEvent
public static void PlayerLoggedInEvent(EntityPlayer player)
{
player.inventory.addItemStackToInventory(new ItemStack(Items.apple, 2));
player.addChatMessage(new ChatComponentText("test"));
}