const itemDamages={leather_helmet:55,leather_chestplate:80,leather_leggings:75,leather_boots:65,netherite_hoe:2031};function buildJSON(e,t,a,r){a="minecraft"==a?"":a+":";const d={parent:"item/handheld"};if(d.textures={layer0:"item/"+t,layer1:"item/"+t+"_overlay"},d.overrides=[],e)for(let e=0;e<r.length;e++)d.overrides[e+1]={predicate:{custom_model_data:e+1},model:a+"item/"+r[e]};else{d.overrides[0]={predicate:{damaged:0,damage:0},model:a+"item/"+t};for(let e=0;e<r.length;e++){const a=r[e],i=(e+1)/(itemDamages[t]-1);d.overrides[e+1]={predicate:{damaged:0,damage:i},model:a}}d.overrides[r.length+1]={predicate:{damaged:1,damage:0},model:"item/"+t}}return JSON.stringify(d,null,2)}