[1.4.7] Items not updating damage values

  • I'm using the latest version of the Industrial Craft API, and testing with the latest version of Industrial Craft off the 1.4.6 pre-release thread.


    I've got an item, which fires an arrow when used. It also looses 1000EU. This works fine, however the damage bar does not update when it's fired. If I put it in a charging device then it works fine (the bar updates and starts charging). I've tried using both ElectricTool.discharge and ElectricTool.use. What's the proper way to do this, is there another function I must run after?

    • Official Post

    The correct method to use is is probably ElectricItem.use which is basically the same as ElectricItem.discharge with backpack power supplying included.


    It should automatically update the item's damage value unless you are using ICustomElectricItem or the item's getMaxDamage() returns less than 3.


    MC will (afaik) replicate the new damage value to the client if the tool is in the currently active inventory slot. If it's not there, you have to update the inventory manually, e.g. with entityplayer.openContainer.updateCraftingResults().

  • ,

    The correct method to use is is probably ElectricItem.use which is basically the same as ElectricItem.discharge with backpack power supplying included.


    It should automatically update the item's damage value unless you are using ICustomElectricItem or the item's getMaxDamage() returns less than 3.


    MC will (afaik) replicate the new damage value to the client if the tool is in the currently active inventory slot. If it's not there, you have to update the inventory manually, e.g. with entityplayer.openContainer.updateCraftingResults().


    Ok, thanks Player. I'll try it.