Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Recipes

Module used to manipulate crafring recipes for vanilla and custom workbenches

Index

Functions

addFurnace

  • addFurnace(sourceId: number, sourceData: number, resultId: number, resultData: number, prefix?: string): void
  • addFurnace(sourceId: number, resultId: number, resultData: number, prefix?: string): void
  • 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

    • Optional prefix: 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

    • Optional prefix: 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

addFurnaceFuel

  • addFurnaceFuel(id: number, data: number, time: number): 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

addShaped

  • Adds new shaped crafting recipe. For example:

    Simple example:

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

    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. E.g. the 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:

      "--"
    • 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.

    • Optional func: CraftingFunction

      function to be called when the craft is processed

    • Optional prefix: string

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

    Returns void

addShaped2

  • addShaped2(id: number, count: number, aux: number, mask: string[], data: (string | number)[], func?: CraftingFunction, prefix?: string): void
  • Same as Recipes.addShaped, but you can specifiy result as three separate values corresponding to id, count and data

    Parameters

    • id: number
    • count: number
    • aux: number
    • mask: string[]
    • data: (string | number)[]
    • Optional func: CraftingFunction
    • Optional prefix: string

    Returns void

addShapeless

  • Adds new shapeless crafting recipe. For example:

    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}]);

    Parameters

    • result: ItemInstance

      recipe result item

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

      crafting ingregients, an array of objects representing item id and data

    • Optional func: CraftingFunction

      function to be called when the craft is processed

    • Optional prefix: string

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

    Returns void

deleteRecipe

getFuelBurnDuration

  • getFuelBurnDuration(id: number, data: number): number
  • Parameters

    • id: number
    • data: number

    Returns number

    fuel burn duration by fuel item id and data

getFurnaceRecipeResult

  • getFurnaceRecipeResult(id: number, data: number, prefix?: string): ItemInstance
  • Parameters

    • id: number
    • data: number
    • Optional prefix: string

      recipe prefix used for non-vanilla furnaces

    Returns ItemInstance

    furnace recipe resulting item

getFurnaceRecipesByResult

  • getFurnaceRecipesByResult(resultId: number, resultData: number, prefix: string): Collection<FurnaceRecipe>
  • 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 Collection<FurnaceRecipe>

    java.util.Collection of

getRecipeByField

getRecipeResult

getWorkbenchRecipesByIngredient

  • getWorkbenchRecipesByIngredient(id: number, data: number): Collection<WorkbenchRecipe>

getWorkbenchRecipesByResult

  • getWorkbenchRecipesByResult(id: number, count: number, data: number): Collection<WorkbenchRecipe>

provideRecipe

removeFurnaceFuel

  • removeFurnaceFuel(id: number, data: number): void
  • Removes furnace fuel by fuel item id and data

    Parameters

    • id: number
    • data: number

    Returns void

removeFurnaceRecipe

  • removeFurnaceRecipe(sourceId: number, sourceData: number): void
  • Removes furnace recipes by source item

    Parameters

    • sourceId: number

      source item id

    • sourceData: number

      source item data

    Returns void

removeWorkbenchRecipe

  • removeWorkbenchRecipe(id: number, count: number, data: number): void
  • Removes recipe by result id, count and data

    Parameters

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

    Returns void

Generated using TypeDoc