> For the complete documentation index, see [llms.txt](https://frinn.gitbook.io/custom-machinery-1.16/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://frinn.gitbook.io/custom-machinery-1.16/mod-integrations/kubejs/recipes/context.md).

# Context

Get some context about the current crafting process

Context is the object provided in the function requirement using the KubeJS integration.

It contains various methods for interacting with the machine.

### Methods

<details>

<summary>Get the remaining crafting time</summary>

#### Name : `remainingTime`

#### Description :

Return a decimal value that represent the time in ticks before the end of the current recipe process.\
This value does not take into account any speed modifiers applied to the machine.

#### Example

```javascript
.requireFunctionEachTick(ctx => {
		var time = ctx.remainingTime;
                //Use time here
	})
```

</details>

<details>

<summary>Get the machine as a tile entity</summary>

#### Name : `tile`

#### Description :

Return a TileEntity, you can use it to get various informations about the machine (couldn't find KubeJS docs for that one sorry).

#### Example

```javascript
.requireFunctionEachTick(ctx => {
		var tile = ctx.tile;
                //Use tile here
	})
```

</details>

<details>

<summary>Get the machine as a custom machine</summary>

#### Name : `machine`

#### Description :

Return a [Machine](/custom-machinery-1.16/mod-integrations/kubejs/recipes/machine.md), you can use it to check, input and output energy, fluids and items from/to the machine.

#### Example

```javascript
.requireFunctionEachTick(ctx => {
		var machine = ctx.machine;
                //Use machine here
	})
```

</details>
