Using an item with any damage value in a recipe

Need help with your script? Want to know how to do something? Want to post an example? Post it here!

Using an item with any damage value in a recipe

Postby FreshBeej » Sun Sep 21, 2014 5:43 am

Heyo I'm having problems with a crafting recipe. The recipe is any axe in the anyAxe oredict and a log will make 3 of the corresponding planks, as well as damaging the axe by 1 point. I can't seem to be able to figure out a way to allow the recipes to use an axe that has any damage value without writing 6000 lines of code. This is the entire script and the related segment is at the very bottom.

: [Select all] [/] [] ()
# early game related bits
vanilla.seeds.removeSeed(<Natura:barley.seed:*>);
vanilla.seeds.removeSeed(<minecraft:wheat_seeds>);

vanilla.seeds.addSeed(<Metallurgy:utility.item:3>.weight(10));
vanilla.seeds.addSeed(<minecraft:wheat_seeds>.weight(4));
<minecraft:wheat_seeds>.displayName = "Wheat Seeds";
vanilla.seeds.addSeed(<Natura:barley.seed:1>.weight(4));
vanilla.seeds.addSeed(<Metallurgy:utility.item:1>.weight(4));



var rock = <Metallurgy:utility.item:3>;
rock.displayName = "Rock";
recipes.addShapedMirrored(<minecraft:cobblestone>, [[rock, rock], [rock, rock]]);
<Metallurgy:utility.item:1>.displayName = "Copper Ore";
<Metallurgy:utility.item:1>.addShiftTooltip(format.green(format.gray("Can be gathered from") + format.darkGreen(" tall grass")));
<Metallurgy:utility.item:5>.displayName = "Copper Fragment";
<Metallurgy:utility.item:5>.addShiftTooltip(format.green(format.gray("Can be crafted into") + format.yellow(" Copper Ingot")));

recipes.remove(<minecraft:stick>);
val oreStick = <ore:stick>;
oreStick.add(<minecraft:stick>);
oreStick.add(<Natura:natura.stick:*>);
oreStick.addShiftTooltip(format.green(format.gray("Can be gathered from") + format.darkGreen(" leaves")));
rock.addShiftTooltip(format.green(format.gray("Can be gathered from") + format.darkGreen(" tall grass")));

recipes.remove(<minecraft:stone_axe>);
recipes.addShapedMirrored(<minecraft:stone_axe>, [[rock, rock], [rock, oreStick]]);
recipes.remove(<minecraft:stone_hoe>);
recipes.addShapedMirrored(<minecraft:stone_hoe>, [[rock, rock], [null, oreStick]]);
recipes.remove(<minecraft:stone_shovel>);
recipes.addShapedMirrored(<minecraft:stone_shovel>, [[null, rock], [null, oreStick]]);
recipes.remove(<minecraft:stone_sword>);
recipes.remove(<minecraft:stone_pickaxe>);
recipes.remove(<minecraft:wooden_sword>);
recipes.remove(<minecraft:wooden_pickaxe>);
recipes.remove(<minecraft:wooden_shovel>);
recipes.remove(<minecraft:wooden_hoe>);
recipes.remove(<minecraft:wooden_axe>);
recipes.remove(<minecraft:diamond_sword>);
recipes.remove(<minecraft:diamond_pickaxe>);
recipes.remove(<minecraft:diamond_shovel>);
recipes.remove(<minecraft:diamond_hoe>);
recipes.remove(<minecraft:diamond_axe>);
recipes.remove(<minecraft:golden_sword>);
recipes.remove(<minecraft:golden_pickaxe>);
recipes.remove(<minecraft:golden_shovel>);
recipes.remove(<minecraft:golden_hoe>);
recipes.remove(<minecraft:golden_axe>);
recipes.remove(<minecraft:iron_sword>);
recipes.remove(<minecraft:iron_pickaxe>);
recipes.remove(<minecraft:iron_shovel>);
recipes.remove(<minecraft:iron_hoe>);
recipes.remove(<minecraft:iron_axe>);

recipes.remove(<Metallurgy:copper.sword>);

furnace.addRecipe(<Metallurgy:utility.item:5>, <Metallurgy:utility.item:1>, 0.5);
recipes.addShapeless(<Metallurgy:copper.ingot>, [<Metallurgy:utility.item:5>, <Metallurgy:utility.item:5>]);

<minecraft:rotten_flesh>.displayName = "Flesh";

var wheatFlour = <Natura:barleyFood:2>;
var barleyFlour = <Natura:barleyFood:1>;
var wheat = <minecraft:wheat>;
var barley = <Natura:barleyFood:0>;
recipes.remove(<minecraft:bread>);
recipes.remove(wheatFlour);
recipes.remove(barleyFlour);
recipes.addShapeless(wheatFlour, [wheat, wheat]);
recipes.addShapeless(barleyFlour, [barley, barley]);

recipes.addShapeless(<SpiceOfLife:bookfoodjournal>, [<minecraft:apple>, <minecraft:paper>]);

var torch = <minecraft:torch>;
recipes.remove(torch);
recipes.addShaped(<minecraft:torch> * 2, [[<minecraft:coal:*>, null], [oreStick, null]]);

<Metallurgy:copper.pickaxe>.addShiftTooltip(format.green(format.gray("Can mine") + format.white(" Cobalt")));

recipes.remove(<minecraft:planks:*>);
recipes.remove(<Natura:planks:*>);
var anyAxe = <ore:anyAxe()>;
anyAxe.add(<Metallurgy:copper.axe>);
anyAxe.add(<Metallurgy:bronze.axe>);
anyAxe.add(<Metallurgy:steel.axe>);
anyAxe.add(<Metallurgy:silver.axe>);

recipes.addShapeless(<minecraft:planks:1> * 3, [anyAxe.transformDamage(), <minecraft:log:1>]);
recipes.addShapeless(<minecraft:planks:2> * 3, [anyAxe.transformDamage(), <minecraft:log:2>]);
recipes.addShapeless(<minecraft:planks:3> * 3, [anyAxe.transformDamage(), <minecraft:log:3>]);
recipes.addShapeless(<minecraft:planks:0> * 3, [anyAxe.transformDamage(), <minecraft:log:0>]);
recipes.addShapeless(<minecraft:planks:4> * 3, [anyAxe.transformDamage(), <minecraft:log2:0>]);
recipes.addShapeless(<minecraft:planks:5> * 3, [anyAxe.transformDamage(), <minecraft:log2:1>]);
GeSHi © Codebox Plus
FreshBeej
 
Posts: 1
Joined: Sun Sep 21, 2014 5:27 am

Re: Using an item with any damage value in a recipe

Postby jyraleteko » Sat May 25, 2019 11:54 am

thanks
Customization of the forum and blog is need of the hour for the people. The affected product is not accepted and a-writer reviews is marked for the students. The customized product is always more liked and welcomed by the majority of the candidates.
jyraleteko
 
Posts: 1
Joined: Sat May 25, 2019 11:53 am


Return to Scripting Help

Who is online

Users browsing this forum: No registered users and 2 guests