Action Configuration
Structure and Configuration
Supports unlimited nested directories
example.yml
hello.yml
world.yml
Nodes
Ensure that each action ID is a unique identifier.
action:
# Action ID
look:
taskTime: 0
shouldExecute: |
false
startTask: |
tell execute
continueExecute: |
false
updateTask: |
tell execute
resetTask: |
tell executeThe action configuration script requires the application of Kether.
| Node | Type | Default Value | Description | Remarks |
|---|---|---|---|---|
| taskTime | int | 0 | Task duration | Specifies the time for the task to execute, in ticks; 20 ticks equals 1 second. |
| shouldExecute | Kether Boolean | Condition required to execute this behavior task | The result being true will start execution. | |
| startTask | Kether | What to do when starting execution | ||
| continueExecute | Kether Boolean | Condition required to continue execution | If the result is true, it will execute updateTask, otherwise it will execute resetTask. | |
| updateTask | Kether | What to execute | After execution, it will check continueExecute. | |
| resetTask | Kether | What to execute | Ends the current task after execution. |
Example
action:
# Action ID is lookowner
look_owner:
# 4 seconds
taskTime: 80
# Condition: the distance between the pet and the owner is less than 2.0
shouldExecute: |
check distance pet entity to pet owner < 2.0
# Message when starting to observe
startTask: |
tell "The pet is preparing to observe you."
# If taskTime is greater than 0, the distance between the pet and owner is less than 2.0, and the pet is not being ridden
continueExecute: |
all [ check distance pet entity to pet owner < 2.0
check taskTime > 0
check pet drive has == false ]
# The pet looks at the owner
updateTask: |
pet look pet owner
tell "The pet is observing you."
# Message when observation ends
resetTask: |
tell "The pet has finished observing."Tip
You may have noticed that the Kether statements in the action configuration include taskTime, which is a statement unique to action configuration.
It retrieves the current value of taskTime. The default value of taskTime in Kether is associated with the taskTime in the node, and with each execution of updateTask, the value of taskTime will decrease.
This means that in each tick, when updateTask is executed, taskTime will decrease by one.