Context

Get some context about the current crafting process

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

It contains various methods for interacting with the machine.

Methods

Get the remaining crafting time

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

.requireFunctionEachTick((ctx as Context) => {
		var time = ctx.remainingTime;
                //Use time here
	})
Get the machine as a tile entity

Name : tile

Description :

Return a MCTileEntity, you can use it to get various information about the machine, see the linked CT wiki page.

Example

.requireFunctionEachTick((ctx as Context) => {
		var tile = ctx.tile;
                //Use tile here
	})
Get the machine as a custom machine

Name : machine

Description :

Return a Machine, you can use it to check, input and output energy, fluids and items from/to the machine.

Example

.requireFunctionEachTick((ctx as Context) => {
		var machine = ctx.machine;
                //Use machine here
	})

Last updated