This repository has been archived on 2024-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
VPModelFileTool/dist/js/calculator.min.js
2023-01-20 19:55:28 +01:00

1 line
No EOL
449 B
JavaScript

function buildJSON(e,t){const a={parent:"item/handheld"};a.textures={layer0:"item/"+e},a.overrides=[],a.overrides[0]={predicate:{damaged:0,damage:0},model:"item/"+e};for(let d=0;d<t.length;d++){const r=t[d],i=(d+1)/itemDamages[e];a.overrides[d+1]={predicate:{damaged:0,damage:i},model:r}}return a.overrides[t.length+1]={predicate:{damaged:1,damage:0},model:"item/"+e},JSON.stringify(a,null,2)}const itemDamages={leather_boots:64,netherite_hoe:2030};