Hi, so I have this script:
event.remove({output: '#forge:plates'});
var done = [];
var sortedTypes = [];
function contains(a, b){
for(var i = 0; i < done.length; i++){
if(done[i] == a){
sortedTypes[i].push(b);
return;
}
}
done.push(a);
sortedTypes.push([b]);
return;
}
Ingredient.of('#forge:plates').stacks.forEach(item =>{
item.getTags().toArray().forEach(tag => {
if(tag.location().path.length() > 'plates/'.length && tag.location().path.substring(0, 'plates/'.length) == 'plates/'){
contains(tag.location().path.substring('plates/'.length), item);
}
})
});
for(var i = 0; i < sortedTypes.length; i++){
sortedTypes[i].sort();
event.shapeless(Item.of(sortedTypes[i][0], 1), [ '#forge:ingots/'+done[i], 'ad_astra:hammer'])
}
});```
And none of the recipes seem to appear on first launch, but all appear upon using /reload. I have a similar problem in a client script in which I am running the exact same code but using it to hide copies of plates from jei instead. I'm assuming it has something to do with when the items are actually given tags or something, but have no idea how to fix it.