Code (Text):
   
 
   
    restore:
    
   display: '%group-color%Restore'
    
   description: "Upon breaking, item has a chance\nto lose this enchantment and repair\nhalf of it's durability"
    
   applies-to: 'Tools'
    
   type: 'ITEM_BREAK'
    
   group: 'ULTIMATE'
    
   applies:
    
   - ALL_PICKAXE
    
   - ALL_SPADE
    
   - ALL_AXE
    
   levels:
    
     1:
    
       chance: 40
    
       effects:
    
       - 'REMOVE_ENCHANT:restore'
    
       - 'ADD_DURABILITY_ITEM:<round><math>-1 * (%maximum durability%/2)</math></round>'
    
       - 'MESSAGE:&6&l*** &e&lItem Restored &6&l***'
    
     2:
    
       chance: 60
    
       effects:
    
       - 'REMOVE_ENCHANT:restore'
    
       - 'ADD_DURABILITY_ITEM:<round><math>-1 * (%maximum durability%/2)</math></round>'
    
       - 'MESSAGE:&6&l*** &e&lItem Restored &6&l***'
    
     3:
    
       chance: 80
    
       effects:
    
       - 'REMOVE_ENCHANT:restore'
    
       - 'ADD_DURABILITY_ITEM:<round><math>-1 * (%maximum durability%/2)</math></round>'
    
       - 'MESSAGE:&6&l*** &e&lItem Restored &6&l***'
    
     4:
    
       chance: 100
    
       effects:
    
       - 'REMOVE_ENCHANT:restore'
    
       - 'ADD_DURABILITY_ITEM:<round><math>-1 * (%maximum durability%/2)</math></round>'
    
       - 'MESSAGE:&6&l*** &e&lItem Restored &6&l***'