############################################################
# Checks if an item is going to take damage based on unbreaking enchantments
############################################################

execute if data storage nucleus:storage root.temp.item.tag.Enchantments[{lvl:1s,id:"minecraft:unbreaking"}] if predicate nucleus:chance/0.5 run function nucleus:item/durability/modify/check/overflow
execute if data storage nucleus:storage root.temp.item.tag.Enchantments[{lvl:2s,id:"minecraft:unbreaking"}] if predicate nucleus:chance/0.33 run function nucleus:item/durability/modify/check/overflow
execute if data storage nucleus:storage root.temp.item.tag.Enchantments[{lvl:3s,id:"minecraft:unbreaking"}] if predicate nucleus:chance/0.25 run function nucleus:item/durability/modify/check/overflow
execute unless data storage nucleus:storage root.temp.item.tag.Enchantments[{id:"minecraft:unbreaking"}] run function nucleus:item/durability/modify/check/overflow
