Posted June 12, 201510 yr Hey im making a mod that has a gui and when you click a button it gives the player that item. I am trying to give the player a piece of lapis, and a wither head. I tried using player.inventory.addItemStackToInventory(new ItemStack(Items....)); but there is no lapis or wither head. Ive also noticed there is no wood when using blocks. how do i give the player these items?
June 12, 201510 yr Guis are on Client side. For items to appear in the player's inventory you need to use that method on server side. To do this, send a packet.
June 12, 201510 yr Author i am sending a packet to the server, everything else works i can give lets say player.inventory.addItemStackToInventory(new ItemStack(Blocks.rail)); and it gives me a rail. but if i try player.inventory.addItemStackToInventory(new ItemStack(Items.lapis)); it doesnt exist, unless im doing this wrong
June 12, 201510 yr new ItemStack(Items.dye, 1, 4) 1.7.10 is no longer supported by forge, you are on your own.
June 12, 201510 yr Author how about minecraft heads, like wither, creeper, etc. and the powered rails
June 12, 201510 yr For some items, such as heads, you need to set NBT data. Checking the Minecraft gamepedia site is often the fastest way to find out exactly what you need, or you can pore through the code (I usually do the latter). http://i.imgur.com/NdrFdld.png[/img]
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.