Package net.citizensnpcs.api.ai.tree
Class Sequence
java.lang.Object
net.citizensnpcs.api.ai.tree.Composite
net.citizensnpcs.api.ai.tree.Sequence
- All Implemented Interfaces:
Behavior
Runs each
Behavior in sequence.-
Field Summary
Fields inherited from class net.citizensnpcs.api.ai.tree.Composite
parallelExecuting -
Method Summary
Modifier and TypeMethodDescriptionstatic SequencecreateSequence(Collection<Behavior> behaviors) Creates sequence that will stop executing if the currentBehaviorreturnsBehaviorStatus.FAILURE.static SequencecreateSequence(Behavior... behaviors) voidreset()Resets the behavior and any state it is holding.run()Runs the behavior for one 'tick', optionally changing the state that it is in.toString()Methods inherited from class net.citizensnpcs.api.ai.tree.Composite
addBehavior, getBehaviors, removeBehavior, shouldExecute, stopExecution, tickParallel
-
Method Details
-
reset
public void reset()Description copied from interface:BehaviorResets the behavior and any state it is holding. -
run
Description copied from interface:BehaviorRuns the behavior for one 'tick', optionally changing the state that it is in.- Returns:
- The new state
-
toString
-
createSequence
-
createSequence
Creates sequence that will stop executing if the currentBehaviorreturnsBehaviorStatus.FAILURE.
-