Athena.systems.inventory.crafting ​
Interfaces ​
Type Aliases ​
ItemCombo ​
Ƭ ItemCombo: [dbName, dbName]
Defined in ​
server/systems/inventory/crafting.ts:9
Quantities ​
Ƭ Quantities: [number, number]
Defined in ​
server/systems/inventory/crafting.ts:11
dbName ​
Ƭ dbName: string
Defined in ​
server/systems/inventory/crafting.ts:7
Functions ​
addRecipe ​
Usage
Athena.systems.inventory.crafting.addRecipe(recipe): boolean
Add a recipe in-memory. Does not store to database.
Example ​
Athena.systems.inventory.crafting.addRecipe({
  combo: ['burger', 'tomato'],
  quantities: [1, 1],
  uid: 'burger-with-tomato',
  result: { dbName: 'burger-with-tomato', quantity: 1 },
});Parameters ​
| Name | Type | 
|---|---|
| recipe | CraftRecipe | 
Returns ​
boolean
Defined in ​
server/systems/inventory/crafting.ts:111
combineItems ​
Usage
Athena.systems.inventory.crafting.combineItems(dataSet, slot1, slot2, type): { dataSet: player[] ; sound?: string } | undefined
Combine two slots given a data set. It will attempt to find a matching recipe and make modifications according to the combination. Returns an object with the modified dataSet, and a sound associated with the crafting recipe if provided in the recipe itself.
Parameters ​
| Name | Type | 
|---|---|
| dataSet | StoredItem[] | 
| slot1 | number | 
| slot2 | number | 
| type | "inventory"|"toolbar"|"custom" | 
Returns ​
{ dataSet: player[] ; sound?: string } | undefined
Defined in ​
server/systems/inventory/crafting.ts:183
findRecipe ​
Usage
Athena.systems.inventory.crafting.findRecipe(combo): CraftRecipe | undefined
Attempts to find a matching recipe. If a matching recipe is found; it is returned. Otherwise, returns undefined.
Parameters ​
| Name | Type | 
|---|---|
| combo | ItemCombo | 
Returns ​
CraftRecipe | undefined
Defined in ​
server/systems/inventory/crafting.ts:139
override ​
Usage
Athena.systems.inventory.crafting.override(functionName, callback): any
Used to override inventory crafting functionality
Parameters ​
| Name | Type | 
|---|---|
| functionName | "addRecipe" | 
| callback | ( recipe:CraftRecipe) =>boolean | 
Returns ​
any
Defined in ​
server/systems/inventory/crafting.ts:302
Usage
Athena.systems.inventory.crafting.override(functionName, callback): any
Used to override inventory crafting functionality
Parameters ​
| Name | Type | 
|---|---|
| functionName | "combineItems" | 
| callback | ( dataSet:StoredItem[],slot1:number,slot2:number,type:"inventory"|"toolbar"|"custom") => {dataSet:player[] ;sound?:string} |undefined | 
Returns ​
any
Defined in ​
server/systems/inventory/crafting.ts:303
Usage
Athena.systems.inventory.crafting.override(functionName, callback): any
Used to override inventory crafting functionality
Parameters ​
| Name | Type | 
|---|---|
| functionName | "findRecipe" | 
| callback | ( combo:ItemCombo) =>CraftRecipe|undefined | 
Returns ​
any
 V5 Docs
V5 Docs