Thornack Posted February 19, 2015 Share Posted February 19, 2015 I want to give the player in survival mode a series of items when the player logs in and when he spawns after death. So far I have tried the following but it doesnt do anything @SubscribeEvent public void onJoinWorld(EntityJoinWorldEvent event) { if (event.entity instanceof EntityPlayer && !event.entity.worldObj.isRemote) { PacketOverlord.sendTo(new PacketSyncPlayerStamina((EntityPlayer) event.entity), (EntityPlayerMP) event.entity); //System.out.println("This is called # 1"); if(Minecraft.getMinecraft().thePlayer != null && Minecraft.getMinecraft().currentScreen instanceof GuiInventory){ //System.out.println("This is not called"); Minecraft.getMinecraft().thePlayer.inventory.addItemStackToInventory(new ItemStack(CommonProxy.itemCustom1)); }} } Not sure what Im doing wrong Quote Link to comment Share on other sites More sharing options...
Failender Posted February 20, 2015 Share Posted February 20, 2015 @SubscribeEvent public void onPlayerJoin(PlayerLoggedInEvent event) { if (!event.player.worldObj.isRemote) { event.player.inventory.addItemStackToInventory(new ItemStack(Items.stick)); } } Ur welcome Quote Link to comment Share on other sites More sharing options...
Nagito Posted August 8, 2017 Share Posted August 8, 2017 I tried using your code, Failender, but it didn't work. If this is outdated, how would you do this now? Quote Link to comment Share on other sites More sharing options...
Ugdhar Posted August 8, 2017 Share Posted August 8, 2017 This post is over 2 years old, and 1.7.10 is no longer supported. You should make sure you are using a recent version, and start a new thread with your issue including code and the fml client latest log Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.