Skip to content

Commit

Permalink
Update example_mod.js
Browse files Browse the repository at this point in the history
  • Loading branch information
slweeb authored Apr 30, 2024
1 parent d98b45f commit df17c9e
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions example_mod.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// More info about enabling, testing, and submitting mods: https://R74ncom.github.io/InfiniteChef-Mods/

// Add a basic ingredient using the 'fruit' ingredient as a base
addIngredient("apple",{
color:"#ff1f40", //red
Expand All @@ -14,10 +16,46 @@ addIngredient("apple",{
shape:"fruit_bipod_stem"
});

// Add ingredient with reactions
addIngredient("water",{
type:"liquid",
color:"#bfd8df",
reactions: {
meat: { set1:"broth" },
vegetable: { set1:"broth", tempMin:60 }
}
});

// Change attributes of existing ingredients
editIngredient("apple",{
color:"#06b000" //green
});

// Add a recipe
// Add a tool
// Add a simple recipe
addRecipe("batter+sugar","cake");

// Add a recipe only in Stack Mode
addRecipe("&stack:batter+sugar","pancake");

// Add a recipe that can't have any other ingredients
addRecipe("=bread+bread","nothing sandwich");

// Add a recipe with an optional ingredient
addRecipe("cake+sprinkles?+chocolate","chocolate cake");

// Add a simple tool to interact with ingredients
addTool("red_dyer", {
func: function(placed) { placed.h = 0; },
shape:"liquid"
})

// Add a tool with more properties
addTool("red_dyer", {
func: function(placed) { placed.h = 0; },
onSelect: function() { alert("Use on an ingredient to dye it red!"); },
whileOn: function() { console.log("Dyer selected."); },
onDeselect: function() { alert("Goodbye!"); },
onClick: function(x,y) { console.log(x,y) },
shape:"liquid",
spin: true
})

0 comments on commit df17c9e

Please sign in to comment.