Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

SequenceContext

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.util.sequence.SequenceContext;

Description

A SequenceContext provides more data to Sequences and allows a sequence to be stopped from inside a task.

Constructors

new<T, U>(sequence as Sequence<T, U>, data as U)
script.zs
// new SequenceContext<T,U>(sequence as Sequence<T, U>, data as U);
new SequenceContext<T, U>(mySequence, myU);

Parameters:

sequence Type: Sequence<T, U>
data Type: U

Members

Getter
Gets the data provided to the sequence.

Note, this can never return null, if the data is null then it will throw an error.

script.zs
// SequenceContext<T,U>.data as U
mySequenceContext.data

Return Type: U

data() as U
Gets the data provided to the sequence.

Note, this can never return null, if the data is null then it will throw an error.

Returns: The data provided to the sequence or an error if null was provided.

script.zs
// SequenceContext<T,U>.data() as U;
mySequenceContext.data();

Return Type: U

stop()
Stop the sequence.
script.zs
// SequenceContext<T,U>.stop();
mySequenceContext.stop();