Solved Huge Durability Issue

Discussion in 'Plugin Help/Development/Requests' started by ninjaboy323, Jul 23, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    ninjaboy323

    Well, I can't seem to find my old post any where so I am just going to make a new one:

    I am still having issue with this, currently I have a custom Item Generator that randomly generates damage on weapons. But the thing is that the way minecraft currently deals with "Durability Damage when you hit someone" is based on how much damage you deal. With an algorithim that damage is then converted into dura damage on the person that you hits armor. Now, my weapons currently have A LOT of damage set to them. I mean A LOT (up to 50k). So this currently is instantly breaking armor the second you hit them. I have tried MANY things:

    - Calling ItemBreak event, getting the broken item and adding it to the inventory as a test. The thing is with this it puts the item in the inventory fine but the item has something like -2000 durability. I have tried to then with a loop or something like that set that durability to max but that doesnt seem to work. Also when you interact with the item at all it dissapears.

    - Looping and setting players armor durability to max. Doesn't work at all, armor still breaks.

    I NEED A METHOD OF DOING THIS.


    Thank you for reading this and I hope that you can help me out.

    Figured it out on my own, for those wondering. I just got a new instance of an itemstack and set the item meta of the new itemstack to the same as the one that was broken. then did whatever I wanted with the new fully repaired version of the item. (For armor I just put the armor back on the person)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 11, 2016
Thread Status:
Not open for further replies.

Share This Page