Interface Behavior

All Known Implementing Classes:
BehaviorGoalAdapter, BlockBreaker, Composite, Decorator, Empty, ForwardingBehaviorGoalAdapter, IfElse, Loop, MoveToGoal, Precondition, Selector, Sequence, StatusCoercer, TargetNearbyEntityGoal, TimerDecorator, WanderGoal

public interface Behavior
The base class for the second iteration of the Goal API, which can be made backwards compatible by extending BehaviorGoalAdapter. A behavior is a common term for the parts of a behavior tree, which is a simple directed acyclic graph (DAG) for AI that is easy for designers to use. It is a simple state machine using BehaviorStatus as the separate states. This can be represented as shouldExecute() returning true -> RUNNING -> FAILURE | SUCCESS. The graph is made up of many Selectors and Sequences, with the leaf nodes being concrete actions.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Resets the behavior and any state it is holding.
    run()
    Ticks the behavior, optionally changing the state that it is in.
    boolean
     
  • Method Details

    • reset

      void reset()
      Resets the behavior and any state it is holding.
    • run

      Ticks the behavior, optionally changing the state that it is in.
      Returns:
      The new status
    • shouldExecute

      boolean shouldExecute()
      Returns:
      Whether the behavior is ready to run