Files
Houngry-I/minecraft/kubejs/server_scripts/recipedump.js
2026-01-16 16:00:54 -05:00

53 lines
996 B
JavaScript

const toggle = false;
ServerEvents.recipes(e => {
ServerEvents.recipes(event => {
let recipes=[];
event.forEachRecipe({},r=>{
// console.log("recipe",r.json.toString())
recipes.push(JSON.parse(r.json.toString()));
});
let recipe=JSON.stringify(recipes);
console.log(recipe);
})
if (toggle) {
console.warn("RECIPE DUMPING IS TURNED ON, THIS WILL DUMP JSON DATA OF ALL OF THE RECIPES IN THE GAME, WILL LAG");
let rec = e.getRecipes();
for (let k in rec) {
let value = [];
try {
for (let i of rec[k]){
try {
value.push(i.json.toString());
} catch (err) {console.log(".");}
}
} catch (err) {console.log("unknown obj: " + JSON.stringify(rec[k]));}
console.log(JSON.stringify({key:k,val:rec[k]}))
}
}
});