Home Commands Examples Getting Started With Scripts Global Keywords

Sequence<T : Object, U : Object>

A sequence is a series of tasks that run after each other when the actor ticks.

For example, when a level ticks.

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.Sequence;

Methods

Gets the context for this sequence.

Returns: The context for this sequence.
Return Type: SequenceContext<T,U>

script.zs
// Sequence.getContext() as SequenceContext<T,U>
mySequence.getContext();

Checks if this sequence is complete.

Returns: true if complete, false otherwise.
Return Type: boolean

script.zs
// Sequence.isComplete() as boolean
mySequence.isComplete();

Checks if this sequence is stopped or not.

Returns: true if stopped, false otherwise.
Return Type: boolean

script.zs
// Sequence.isStopped() as boolean
mySequence.isStopped();

Stops this sequence, subsequent tasks will not be ran.

script.zs
// Sequence.stop()
mySequence.stop();

Ticks this sequence.

script.zs
// Sequence.tick()
mySequence.tick();

Properties

NameTypeHas GetterHas SetterDescription
Name
context
Type
SequenceContext<T,U>
Has Getter
true
Has Setter
false
Description
Gets the context for this sequence.
Name
isComplete
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks if this sequence is complete.
Name
stopped
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks if this sequence is stopped or not.