recipes.addShapeless("nether_recipe",<minecraft:netherrack>,[<ore:cobblestone>,<ore:cobblestone>,<ore:cobblestone>], function (out,ins,info) { return info.player.world.dimension==-1? out :null; },null);
例子三:继承原有NBT的升级配方(即可以做到升级镐后保留原来的附魔)
import crafttweaker.data.IData;recipes.addShaped("tag",<minecraft:diamond_pickaxe>,[ [<ore:gemDiamond>,<ore:gemDiamond>,<ore:gemDiamond>], [null,<minecraft:golden_pickaxe:*>.marked("p"),null]],// 注意金镐被标记了 function(out,ins,info){ var data asIData=ins.p.tag; // 获取标记为p的金镐的NBT return out.withTag(data); // 返回包含这个NBT的输出——钻石镐 },null);
recipes.remove(<chisel:chisel_hitech>);recipes.addShapeless("ichisel_tinker_go",<chisel:chisel_hitech>,[<tcomplement:chisel>.marked("t"),<minecraft:redstone_block>,<minecraft:emerald>], function(out,input,info){ var globaltdata asIData=input.t.tag; var stat asIData=globaltdata.Stats; var du asint=stat.Durability.asInt(); var material asstring=globaltdata.TinkerData.Materials.asString(); var n asint=3; for i in 3..material.length { if (material[i] ==",") { n = i -1; break; } } var displaystring asstring="Material : "+material.substring(2,n); var meta asint= max(0,10049- du); var display asIData= {display:{Lore:[displaystring]}}; var Minmeta asIData= {Minmeta: meta asint}; var materialInData asIData= {Material:material.substring(2,n)}; return out.definition.makeStack(meta).withTag(display + Minmeta + materialInData); },null);recipes.addShapeless("ichisel_repair",<chisel:chisel_hitech>,[<chisel:chisel_hitech>.anyDamage().marked("c"),<tconstruct:sharpening_kit>.marked("s")], function(out,input,info){ var du asint=input.c.damage; var Minmeta asint=input.c.tag.Minmeta.asInt(); if (input.s.tag.Material!=input.c.tag.Material){ return null; } else { var shouldRepair asint= du - Minmeta; if (!shouldRepair >=1) { return null; } else { du -= max(1024,shouldRepair /2); du = max(du,Minmeta); return out.definition.makeStack(du).withTag(input.c.tag); } } },null);