Package cn.nukkit.entity.ai.executor
Interface IBehaviorExecutor
- All Known Subinterfaces:
IBehavior
- All Known Implementing Classes:
AbstractBehavior
,AnimalGrowExecutor
,Behavior
,EatGrassExecutor
,EntityBreedingExecutor
,EntityExplosionExecutor
,EntityMoveToOwnerExecutor
,FlatRandomRoamExecutor
,InLoveExecutor
,LookAtFeedingPlayerExecutor
,LookAtTargetExecutor
,MeleeAttackExecutor
,MoveToTargetExecutor
,MultipleExecutor
,ShootExecutor
,SleepOnOwnerBedExecutor
,SpaceRandomRoamExecutor
,TameHorseExecutor
,WardenMeleeAttackExecutor
,WardenRangedAttackExecutor
,WardenSniffExecutor
,WardenViolentAnimationExecutor
,WeightedMultiBehavior
,WolfAttackExecutor
行为执行器
在实体上执行具体的行为
对于每个实例化的实体,此对象应只会实例化一次,且一直伴随实体不会改变
在实体上执行具体的行为
对于每个实例化的实体,此对象应只会实例化一次,且一直伴随实体不会改变
Behavior executor
Executes specific behavior on the entity
For each instantiated entity, this object should only be instantiated once, and the entity will not change all the time
-
Method Summary
Modifier and TypeMethodDescriptionboolean
execute
(EntityIntelligent entity) 调度器将会持续执行此执行器,直到返回false,或者执行器被中断
此方法每gt都会调用default void
onInterrupt
(EntityIntelligent entity) 行为非正常中断时(例如被更高级行为覆盖)调用default void
onStart
(EntityIntelligent entity) 行为评估成功后,进入激活状态前调用default void
onStop
(EntityIntelligent entity) 行为正常结束时(execute()方法返回false)调用
-
Method Details
-
execute
调度器将会持续执行此执行器,直到返回false,或者执行器被中断
此方法每gt都会调用The scheduler will continue to execute this executor until it returns false or the executor is interrupted
This method will be called every gt- Parameters:
entity
- 执行目标实体- Returns:
- boolean
-
onInterrupt
行为非正常中断时(例如被更高级行为覆盖)调用Called when behavior breaks abnormally (e.g. overridden by higher-level behavior)
- Parameters:
entity
- 目标实体
-
onStart
行为评估成功后,进入激活状态前调用After the behavior evaluation is successful, it is called before entering the active state
- Parameters:
entity
- 目标实体
-
onStop
行为正常结束时(execute()方法返回false)调用Called when the behavior ends normally (the execute() method returns false)
- Parameters:
entity
- 目标实体
-