AbstractAITask method purposes

I’ve been looking at the AbstractAITask class, and I think I kind of understand the purposes of each method, I just have a few questions:

  • Is it possible for Tasks to be removed by the AI system (not programmatically)?
  • If the task begins returning false in the continueUpdating , and then returns true again, will it start updating again
  • What exactly is the contract/purpose of reset?
  • How much of the AITasks framework is currently implemented? Could I create an AITask and reliably apply it?
  • How often is a Task’s update method called?
  • Can I reliably call getOwner and expect it to exist in the update, start, shouldUpdate, and continueUpdating?

@Zidane I know your the creating the AI API, so I figured you may be the best candidate to answer my questions.

Any help is greatly appreciated!

######(My precious enchantments shall be usable by mobs!!! MUWHAHAHAHHAHAA )

  • Is it possible for Tasks to be removed by the AI system (not programmatically)?
    Yes. Use [these methods] (https://github.com/SpongePowered/SpongeAPI/blob/master/src/main/java/org/spongepowered/api/entity/ai/Goal.java#L69-L84).
  • If the task begins returning false in the continueUpdating , and then returns true again, will it start updating again?
    Only when shouldUpdate() returns true.
  • What exactly is the contract/purpose of reset?.
    To initialize the task without calling the constructor. Called after the task returns false in continueUpdating.
  • How often is a Task’s update method called?
    Once per tick I suppose.
  • Can I reliably call getOwner and expect it to exist in the update, start, shouldUpdate, and continueUpdating?
    I guess so.