Namespace Recipes

Module used to manipulate crafting recipes for vanilla and custom workbenches.

Functions

  • Adds new furnace recipe.

    Parameters

    • sourceId: number

      source item ID

    • sourceData: number

      source item data

    • resultId: number

      resulting item ID

    • resultData: number

      resulting item data

    • Optionalprefix: string

      prefix, used to create recipes for non-vanilla furnaces

    Returns void

  • Adds new furnace recipe with no need to manually specify input item data (it defaults to -1).

    Parameters

    • sourceId: number

      source item ID

    • resultId: number

      result item ID

    • resultData: number

      resulting item data

    • Optionalprefix: string

      prefix, used to create recipes for non-vanilla furnaces; if the prefix is not empty and some recipes for this source exist for vanilla furnace, they are removed

    Returns void

  • Adds fuel that can be used in the furnace.

    Parameters

    • id: number

      fuel item ID

    • data: number

      fuel item data

    • time: number

      burning time in ticks

    Returns void

  • Adds new shaped crafting recipe.

    Parameters

    • result: ItemInstance

      recipe result item

    • mask: string[]

      recipe shape, up to three string corresponding to the three crafting field rows; each character means one item in the field

    • data: (string | number)[]

      an array explaining the meaning of each character within mask. The array should contain three values for each symbol: the symbol itself, item ID and item data.

    • Optionalfunc: CraftingFunction

      function to be called when the craft is processed

    • Optionalprefix: string

      recipe prefix. Use a non-empty values to register recipes for custom workbenches

    Returns WorkbenchShapedRecipe

    Recipes.addShaped({ id: 264, count: 1, data: 0 }, [
    "ax",
    "xa",
    "ax"
    ], ['x', 265, 0, 'a', 266, 0]);

    Pickaxe recipe should look like this:

    "+++"
    " | "
    " | "
    

    Do not use empty lines or line endings, if the recipe can be placed within less then three rows or cols; e.g., to craft plates, you can use a shape like this:

    "--"
    
  • Adds new shapeless crafting recipe.

    Parameters

    • result: ItemInstance

      recipe result item

    • data: {
          data: number;
          id: number;
      }[]

      crafting ingredients, an array of objects representing item ID and data

    • Optionalfunc: CraftingFunction

      function to be called when the craft is processed

    • Optionalprefix: string

      recipe prefix; use a non-empty values to register recipes for custom workbenches

    Returns WorkbenchShapelessRecipe

    Recipes.addShapeless({ id: 264, count: 1, data: 0 }, [
    { id: 265, data: 0 }, { id: 265, data: 0 }, { id: 265, data: 0 },
    { id: 266, data: 0 }, { id: 266, data: 0 }, { id: 266, data: 0 }
    ]);
  • Deletes recipe by it's result.

    Parameters

    Returns void

  • Parameters

    • id: number
    • data: number

    Returns number

    Fuel burn duration by fuel item ID and data.

  • Parameters

    • id: number
    • data: number
    • Optionalprefix: string

      recipe prefix used for non-vanilla furnaces

    Returns ItemInstance

    Furnace recipe resulting item.

  • Gets furnace recipes by result and custom prefix.

    Parameters

    • resultId: number

      result item ID

    • resultData: number

      result item data

    • prefix: string

      recipe prefix used for non-vanilla furnaces

    Returns java.util.Collection<FurnaceRecipe>

    Collection object with all furnace recipes found by given params.

  • Removes furnace fuel by fuel item ID and data.

    Parameters

    • id: number
    • data: number

    Returns void

  • Removes furnace recipes by source item.

    Parameters

    • sourceId: number

      source item ID

    • sourceData: number

      source item data

    Returns void

  • Removes recipe by result ID, count and data.

    Parameters

    • id: number
    • count: number
    • data: number

    Returns void

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.