Custom Behaviors
Control pet behaviors, such as following players, attacking enemies, or performing specific actions, making pets more intelligent and interactive.
Priority
Before starting this tutorial, we need to understand the behavior priority settings.
The lower the priority value, the sooner it is executed.
The behavior priority is set through the Pet Configuration.
pet:
action:
- id: attack
priority: 11
- id: walk
priority: 10
- id: lookowner
priority: 9First, lookowner is executed.
When the continueExecute result of lookowner is false, walk is executed.
Edit the configuration.
When the continueExecute result of walk is false, attack is executed.
When the continueExecute result of attack is false, lookowner is executed again.
This process continues in a loop.
Mind Map Explanation of the Mechanism

taskTime
You might notice that the behavior configuration in Kether scripts includes taskTime. This is a specific parameter for behavior configuration.
It retrieves the current value of taskTime. The default value of Kether's taskTime is linked to the taskTime node. Each time updateTask is executed, the value of taskTime decreases.
This means that with each tick, when updateTask is executed, taskTime is reduced by one.
check taskTime > 0