Posted August 23, 201213 yr i need code for player get item on gui (actionPerfomed) ps.sorry my bad english
August 24, 201213 yr For getting the currently equipped item, use: FMLClientHandler.instance().getClient().thePlayer.getCurrentEquippedItem();
August 24, 201213 yr If you want to give an item to the player, you can do something like this: FMLClientHandler.instance().getClient().thePlayer.inventory.addItemStackToInventory(new ItemStack(Item.coal, 1)); This would give the player 1 coal. Change Item.coal to whatever item you want to give and '1' to the amount you want to give.
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.