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
2024-04-14 19:23:52 +02:00

1 line
No EOL
718 B
JavaScript

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