Adding a way to get the amount of item damage in an "on item damage" event. #5258
Closed
1 task done
Labels
completed
The issue has been fully resolved and the change will be in the next Skript update.
enhancement
Feature request, an issue about something that could be improved, or a PR improving something.
priority: lowest
"Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Suggestion
I'm suggesting the addition of the getDamage() method in the org.bukkit.event.player.PlayerItemDamageEvent as a vanilla skript expression.
It could be the same as in an on damage event, for example instead of:
on damage:
if damage is more than 1:
send "ouch" to victim
it would be something like:
on item damage:
if item damage is 0:
send "Unbreaking has triggered" to player
Why?
Currently there is no way to differentiate between unbreaking "blocking" the 1 item damage of the item, and just the usual durability reduction without using skript-reflect!
Other
Agreement
The text was updated successfully, but these errors were encountered: