1

Item damage value

youbewantin's Avatar youbewantin11/30/13 1:10 pm
1 emeralds 365 7
12/7/2013 5:13 pm
bmanrules's Avatar bmanrules
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!
Posted by youbewantin's Avatar
youbewantin
Level 1 : New Miner
0

Create an account or sign in to comment.

7

1
12/07/2013 5:13 pm
Level 57 : Grandmaster Programmer
bmanrules
bmanrules's Avatar
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
12/07/2013 4:46 pm
Level 1 : New Miner
youbewantin
youbewantin's Avatar
bump
1
11/30/2013 4:48 pm
Level 1 : New Miner
youbewantin
youbewantin's Avatar
item class i mean
1
11/30/2013 2:10 pm
Level 57 : Grandmaster Programmer
bmanrules
bmanrules's Avatar
Use

par1ItemStack.damageItem(1, par2EntityPlayer);
1
11/30/2013 4:47 pm
Level 1 : New Miner
youbewantin
youbewantin's Avatar
does that go in the item i am damaging? or in the iinventory item?
1
11/30/2013 1:34 pm
Level 63 : High Grandmaster Modder
froghog
froghog's Avatar
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
11/30/2013 1:20 pm
Level 29 : Expert Network
Oni__
Oni__'s Avatar
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.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome