1
Item damage value
i created an item that is kindof like a backpack, in that when right click it opens up the inventory, and there is a single slot in which certain items can be placed. i also gave the item metadata, so that the icon is changed when the damage of the item is changed. i am currently looking at the class which implements IInventory, in "public void onInventoryChanged." what i am currently trying to figure out is how to change the damage value of the (backpack-like)item when MY item (that i created) is in the slot (that is in the item that i created.) i am already able to test if the item is in the slot, but for the life of me, i cannot figure out how to change the damage value of the item! please help! if anymore info is needed, just ask
thanks in advanced!
thanks in advanced!
Create an account or sign in to comment.
7
1
That goes wherever you want it to be damaged (i.e. if you want to damage it when it's interacted with a mob, put it in interact of the mob or whatever)
1
bump
1
item class i mean
1
Use
par1ItemStack.damageItem(1, par2EntityPlayer);
1
does that go in the item i am damaging? or in the iinventory item?
1
ONI_LINK
Or you could possibly look at the furnace code, that does a similar sort of thing to change it to a burning furnace.
yeah i dont think that part will work
1
Have you tried using a variant of the wool dyeing system? That changes the damage value but I don't quite know how feasible it is to change it.
Or you could possibly look at the furnace code, that does a similar sort of thing to change it to a burning furnace.
I dont code though so I'm probably wrong.
Or you could possibly look at the furnace code, that does a similar sort of thing to change it to a burning furnace.
I dont code though so I'm probably wrong.