pluginiPlugin

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.

imiPetCore/pet/xxx.yml
pet:
  action:
    - id: attack
      priority: 11
    - id: walk
      priority: 10
    - id: lookowner
      priority: 9

First, 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

ai-controller

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.

Example: Check if taskTime is greater than 0
check taskTime > 0

On this page