Home Commands Examples Getting Started With Scripts Global Keywords

SequenceContext<T : Object, U : Object>

A SequenceContext provides more data to Sequence<T,U>s and allows a sequence to be stopped from inside a task.

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

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

Constructors

script.zs
new SequenceContext<T,U>(sequence as Sequence<T,U>, data as U) as SequenceContext<T,U>
ParameterType
Parameter
sequence
Type
Sequence<T,U>
Parameter
data
Type
U

Methods

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.
Return Type: U

script.zs
// SequenceContext.getData() as U
mySequenceContext.getData();

Stop the sequence.

script.zs
// SequenceContext.stop()
mySequenceContext.stop();

Properties

NameTypeHas GetterHas SetterDescription
Name
data
Type
U
Has Getter
true
Has Setter
false
Description
Gets the data provided to the sequence.

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