Quick question, I'm trying to use JsonIO.read to see if there's a model file for a block already created in a block.registry event, but when I do the check for it, it doesn't throw a err, am I doing something wrong?
try {
console.log(`Attempting load of model info...`);
let cache = JsonIO.read(`kubejs/assets/kubejs/models/block/${metalInfo[0]}_${ItemID}_${b}.json`);
} catch (err) {
console.log(`Error: Model File doesn't exist, creating... (Err): ${err}`);
JsonIO.write(`kubejs/assets/kubejs/models/block/${metalInfo[0]}_${ItemID}_${b}.json`, JsonData);
}
I see Attempting load of model info.. in the logs, but I don't see the Error: line, and it can't be reading anything, cause it doesn't exist. It just fail quietly, did I mess something up?