Posted September 2, 20169 yr So this is all guess work bu i have up with this for NBT NBTTagCompound nbt = new NBTTagCompound(); nbt.setString("modle", "blockDiamond"); nbt.setString("owner",player.getDisplayNameString()); nbt.setString("date", String.format("%1$td/%1$tm/%1$tY", System.currentTimeMillis())); ItemStack item= moddedAchievement.item(); item= new ItemStack(item.getItem(), item.stackSize, iem.getMetadata(), nbt); This is obviously wrong but this is my first attempt of giving a item stack NBT I have also tire the write to nbt method with no luck away the item stack is added to player like this player.inventory.addItemStackToInventory(item) if it is important all this is only happening server side
September 2, 20169 yr Do not use the ItemStack(Item, int, int, NBTTagCompound) constructor, the fourth argument is for the capability data rather than the stack's compound tag. Use ItemStack#setTagCompound to set the stack's compound tag. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
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.