I'm having items spawn in the world, but each will have a unique variable value assigned to them. To prevent players from hunting and pecking, I want to make it so that variable is only assigned once the player picks up the item. Is that possible?
* Adds the item stack to the inventory, returns false if it is impossible.
public boolean addItemStackToInventory(ItemStack par1ItemStack)
//REST OF CODE...
Not here to help, but is there a way to find if the player has an item in his/her hand? Or has armor on? I am trying to make my tools/armor admit light when the player is holding/wearing the item(s). If there is a way it would be of great help.
yes, you have to add the method to detect if the player has the item you are looking for in their inventory and then edit the pre-made variable type to be what you want, i.e. assign in the item block whatever,
public static int test;
and inside the if else statement add
itemnamehere.test = 1;
this should work if not ill try and resolve as much as i can