-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
None
-
N/A
-
Yes
On the Javadocs this event says
"The item that's breaking will exist in the inventory with a stack size of 0. After the event, the item's durability will be reset to 0."
but this isn't exactly accurate and I suggest it should say something like
"After this event, the item's amount will be set to (item amount)-1 and its durability will be reset to 0"
The current text sounds like in the event the amount of the items is 0 and you should be able to set its amount to 1 to cancel this event but this is not the case and you need to do event.getBrokenItem().setAmount(2); since after the event it takes 1 away from the amount.