[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / inventory/workstationTakes

# inventory/workstationTakes

## Interfaces

### StationCraft

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:108](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L108)

What a stonecutter or a smithing table made, and the recipe it made it by.

#### Properties

##### recipeId

> `readonly` **recipeId**: `string`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:112](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L112)

The recipe the stack was made by.

##### spent

> `readonly` **spent**: readonly [`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md)[]

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:114](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L114)

The stacks the craft spent from, as they were before it.

##### stack

> `readonly` **stack**: [`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md)

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:110](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L110)

The finished stack, which the client takes out of the result slot.

***

### WorkstationCraft

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:45](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L45)

What a workstation craft produced, and what it cost.

#### Properties

##### cost

> `readonly` **cost**: `number`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:49](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L49)

Experience levels spent.

##### stack

> `readonly` **stack**: [`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md)

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:47](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L47)

The finished stack, which the client takes out of the result slot.

## Type Aliases

### CartographyLevel

> **CartographyLevel** = `Pick`\<[`Level`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/Level/classes/Level.md), `"getMap"` \| `"addMap"`\>

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:246](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L246)

The saved maps a cartography table reads, and saves a zoomed or locked copy in.

***

### WorkstationPlayer

> **WorkstationPlayer** = [`EnchantingPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/enchantment/enchantingTable/index.md#enchantingplayer) & [`KeyedPlayerHolder`](https://jsprismarine.dev/api/@jsprismarine/prismarine/keyedPlayer/index.md#keyedplayerholder) & `Parameters`\<*typeof* [`takeFromAnvil`](https://jsprismarine.dev/api/@jsprismarine/prismarine/enchantment/anvil/index.md#takefromanvil)\>\[`1`\]

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:42](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L42)

The player at a workstation: who is shown the enchanting table's rows, whose seed draws them,
who is told of an enchanting, and whose experience a craft spends.

## Variables

### CARTOGRAPHY\_ADDITION

> `const` **CARTOGRAPHY\_ADDITION**: `1` = `1`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:240](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L240)

The cartography table's second slot: paper, an empty map or a glass pane.

***

### CARTOGRAPHY\_MAP

> `const` **CARTOGRAPHY\_MAP**: `0` = `0`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:237](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L237)

The cartography table's map slot.

***

### SMITHING\_INPUTS

> `const` **SMITHING\_INPUTS**: `3` = `3`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:201](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L201)

The smithing table's template, base and addition slots.

***

### STONECUTTER\_DATA\_RECIPE

> `const` **STONECUTTER\_DATA\_RECIPE**: `0` = `0`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:121](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L121)

The stonecutter screen's one property: the picked recipe's place in the list, or -1 for none.

***

### STONECUTTER\_INPUT

> `const` **STONECUTTER\_INPUT**: `0` = `0`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:118](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L118)

The stonecutter's input slot.

***

### WORKSTATION\_ITEM

> `const` **WORKSTATION\_ITEM**: `0` = `0`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:33](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L33)

The slot the item being worked on sits in.

***

### WORKSTATION\_MATERIAL

> `const` **WORKSTATION\_MATERIAL**: `1` = `1`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:36](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L36)

The slot the material sits in: an enchanting table's lapis, an anvil's second item.

## Functions

### cartographyResultOf()

> **cartographyResultOf**(`open`, `level`): [`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md) \| `undefined`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:274](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L274)

The stack a cartography table's result slot holds: the map zoomed out one step with paper, while
it is not locked and not at the widest zoom; locked with a glass pane, while it is not locked
already; or cloned onto an empty map, two maps in all. The zoom and the lock are marked on the
stack and made as it is taken, when the level saves the new map under an id of its own.

#### Parameters

##### open

`Pick`\<[`OpenBlockContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/PlayerSession/index.md#openblockcontainer), `"inputs"`\>

##### level

[`CartographyLevel`](#cartographylevel)

The level the map is saved in.

#### Returns

[`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md) \| `undefined`

Undefined when the slots make nothing, or the map has no saved data.

#### Java Source

CartographyTableMenu.setupResultSlot

***

### cartographySlotTakes()

> **cartographySlotTakes**(`slot`, `item`): `boolean`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:259](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L259)

Whether a cartography table's slot takes a stack: the map slot a map with saved data's id, the
second slot paper, an empty map or a glass pane.

#### Parameters

##### slot

`number`

The slot: [CARTOGRAPHY\_MAP](#cartography-map) or [CARTOGRAPHY\_ADDITION](#cartography-addition).

##### item

[`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md)

#### Returns

`boolean`

#### Java Source

CartographyTableMenu$3.mayPlace

#### Java Source

CartographyTableMenu$4.mayPlace

***

### pickStonecutterRecipe()

> **pickStonecutterRecipe**(`open`, `content`, `index`): `boolean`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:154](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L154)

Picks a stonecutter recipe by its place in the input's list, as a Java client's button does.

#### Parameters

##### open

`Pick`\<[`OpenBlockContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/PlayerSession/index.md#openblockcontainer), `"inputs"` \| `"pickedRecipe"`\>

##### content

[`ServerContent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/ServerContent/index.md#servercontent)

##### index

`number`

#### Returns

`boolean`

Whether the pick changed the result: false for the recipe already picked or a place the list does not have.

#### Java Source

StonecutterMenu.clickMenuButton

***

### smithingResultOf()

> **smithingResultOf**(`open`, `content`): \{ `match`: [`RecipeMatch`](https://jsprismarine.dev/api/@jsprismarine/recipes/index.md#recipematch); `stack`: [`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md); \} \| `undefined`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:208](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L208)

The stack the smithing table's result slot holds: what the first recipe its three slots match
makes of them, or undefined when they match none.

#### Parameters

##### open

`Pick`\<[`OpenBlockContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/PlayerSession/index.md#openblockcontainer), `"inputs"`\>

##### content

[`ServerContent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/ServerContent/index.md#servercontent)

#### Returns

\{ `match`: [`RecipeMatch`](https://jsprismarine.dev/api/@jsprismarine/recipes/index.md#recipematch); `stack`: [`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md); \} \| `undefined`

#### Java See

SmithingMenu.createResult

***

### stonecutterInputChanged()

> **stonecutterInputChanged**(`open`, `before`): `boolean`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:172](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L172)

Forgets the stonecutter's pick when the kind of item in its input changed, as vanilla lists the
recipes again with none picked.

#### Parameters

##### open

`Pick`\<[`OpenBlockContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/PlayerSession/index.md#openblockcontainer), `"inputs"` \| `"pickedRecipe"`\>

##### before

[`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md) \| `null`

The input before the change.

#### Returns

`boolean`

Whether the pick was forgotten.

#### Java Source

StonecutterMenu.slotsChanged

***

### stonecutterRecipesFor()

> **stonecutterRecipesFor**(`open`, `content`): readonly [`RecipeMatch`](https://jsprismarine.dev/api/@jsprismarine/recipes/index.md#recipematch)[]

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:128](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L128)

The stonecutter recipes the stack in its input slot is cut by, in the order a Java client
lists them and picks one by.

#### Parameters

##### open

`Pick`\<[`OpenBlockContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/PlayerSession/index.md#openblockcontainer), `"inputs"`\>

##### content

[`ServerContent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/ServerContent/index.md#servercontent)

#### Returns

readonly [`RecipeMatch`](https://jsprismarine.dev/api/@jsprismarine/recipes/index.md#recipematch)[]

#### Java See

SelectableRecipe$SingleInputSet.selectByInput

***

### stonecutterResultOf()

> **stonecutterResultOf**(`open`, `content`): [`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md) \| `undefined`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:136](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L136)

The stack the stonecutter's result slot holds: what the picked recipe makes of the input, or
undefined while no recipe is picked or the pick is not one of the input's.

#### Parameters

##### open

`Pick`\<[`OpenBlockContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/PlayerSession/index.md#openblockcontainer), `"inputs"` \| `"pickedRecipe"`\>

##### content

[`ServerContent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/ServerContent/index.md#servercontent)

#### Returns

[`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md) \| `undefined`

#### Java See

StonecutterMenu.setupResultSlot

***

### takeAnvilResult()

> **takeAnvilResult**(`player`, `open`, `registry`, `name?`, `infinite?`): [`WorkstationCraft`](#workstationcraft) \| `undefined`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:96](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L96)

Takes an anvil's result: the two inputs combined, renamed to whatever the player typed.

#### Parameters

##### player

[`WorkstationPlayer`](#workstationplayer)

##### open

[`OpenBlockContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/PlayerSession/index.md#openblockcontainer)

##### registry

[`EnchantmentRegistry`](https://jsprismarine.dev/api/@jsprismarine/enchantments/classes/EnchantmentRegistry.md)

##### name?

`string`

##### infinite?

`boolean` = `false`

Whether the player has infinite materials, who pays no levels.

#### Returns

[`WorkstationCraft`](#workstationcraft) \| `undefined`

Undefined when there is nothing in the base slot, the combination does nothing, or
  the player cannot pay.

***

### takeCartographyResult()

> **takeCartographyResult**(`open`, `level`): [`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md) \| `undefined`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:301](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L301)

Takes a cartography table's result: one of each slot goes into it, and a zoomed or locked map
is saved under a new id.

#### Parameters

##### open

`Pick`\<[`OpenBlockContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/PlayerSession/index.md#openblockcontainer), `"inputs"`\>

##### level

[`CartographyLevel`](#cartographylevel)

The level the map is saved in.

#### Returns

[`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md) \| `undefined`

Undefined when the slots make nothing.

#### Java See

CartographyTableMenu$5.onTake

***

### takeEnchantRow()

> **takeEnchantRow**(`player`, `open`, `row`, `registry`, `infinite?`): [`WorkstationCraft`](#workstationcraft) \| `undefined`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:63](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L63)

Takes one of an enchanting table's three rows, by its place from 0.

`takeEnchantingRow` is what charges for it and rerolls the seed, so a caller cannot enchant
twice from one draw, and it redraws the row from the stored seed rather than trusting the
client's number for anything but which of the three.

#### Parameters

##### player

[`WorkstationPlayer`](#workstationplayer)

##### open

[`OpenBlockContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/PlayerSession/index.md#openblockcontainer)

##### row

`number`

##### registry

[`EnchantmentRegistry`](https://jsprismarine.dev/api/@jsprismarine/enchantments/classes/EnchantmentRegistry.md)

##### infinite?

`boolean` = `false`

Whether the player has infinite materials, so needs no levels for the row.

#### Returns

[`WorkstationCraft`](#workstationcraft) \| `undefined`

Undefined when there is no item in the table, the row is empty, or the player cannot
  pay - each of which is a refusal rather than a free enchantment.

***

### takeSmithingResult()

> **takeSmithingResult**(`open`, `content`): [`StationCraft`](#stationcraft) \| `undefined`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:222](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L222)

Takes the smithing table's result: one of each of the template, the base and the addition
goes into it.

#### Parameters

##### open

[`OpenBlockContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/PlayerSession/index.md#openblockcontainer)

##### content

[`ServerContent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/ServerContent/index.md#servercontent)

#### Returns

[`StationCraft`](#stationcraft) \| `undefined`

Undefined when the slots make nothing.

#### Java See

SmithingMenu.onTake

***

### takeStonecutterResult()

> **takeStonecutterResult**(`open`, `content`): [`StationCraft`](#stationcraft) \| `undefined`

Defined in: [packages/prismarine/src/inventory/workstationTakes.ts:188](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationTakes.ts#L188)

Takes the stonecutter's result: one of the input is cut into the picked recipe's stack. The
pick lasts while the input does.

#### Parameters

##### open

[`OpenBlockContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/PlayerSession/index.md#openblockcontainer)

##### content

[`ServerContent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/ServerContent/index.md#servercontent)

#### Returns

[`StationCraft`](#stationcraft) \| `undefined`

Undefined when the result slot holds nothing.

#### Java See

StonecutterMenu$2.onTake
