Package cn.nukkit.entity.ai.executor
Class LookAtTargetExecutor
java.lang.Object
cn.nukkit.entity.ai.executor.AboutControlExecutor
cn.nukkit.entity.ai.executor.LookAtTargetExecutor
- All Implemented Interfaces:
IBehaviorExecutor
@PowerNukkitXOnly
@Since("1.6.0.0-PNX")
public class LookAtTargetExecutor
extends AboutControlExecutor
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected int
protected Class<? extends Vector3Memory<?>>
-
Constructor Summary
ConstructorDescriptionLookAtTargetExecutor
(Class<? extends Vector3Memory<?>> memoryClazz, int duration) -
Method Summary
Modifier and TypeMethodDescriptionboolean
execute
(EntityIntelligent entity) 调度器将会持续执行此执行器,直到返回false,或者执行器被中断
此方法每gt都会调用void
onInterrupt
(EntityIntelligent entity) 行为非正常中断时(例如被更高级行为覆盖)调用void
onStop
(EntityIntelligent entity) 行为正常结束时(execute()方法返回false)调用Methods inherited from class cn.nukkit.entity.ai.executor.AboutControlExecutor
onStart, removeLookTarget, removeRouteTarget, setLookTarget, setRouteTarget
-
Field Details
-
memoryClazz
-
duration
protected int duration -
currentTick
protected int currentTick
-
-
Constructor Details
-
LookAtTargetExecutor
-
-
Method Details
-
execute
Description copied from interface:IBehaviorExecutor
调度器将会持续执行此执行器,直到返回false,或者执行器被中断
此方法每gt都会调用- Specified by:
execute
in interfaceIBehaviorExecutor
- Overrides:
execute
in classAboutControlExecutor
- Parameters:
entity
- 执行目标实体- Returns:
- boolean
-
onInterrupt
Description copied from interface:IBehaviorExecutor
行为非正常中断时(例如被更高级行为覆盖)调用- Specified by:
onInterrupt
in interfaceIBehaviorExecutor
- Overrides:
onInterrupt
in classAboutControlExecutor
- Parameters:
entity
- 目标实体
-
onStop
Description copied from interface:IBehaviorExecutor
行为正常结束时(execute()方法返回false)调用- Specified by:
onStop
in interfaceIBehaviorExecutor
- Overrides:
onStop
in classAboutControlExecutor
- Parameters:
entity
- 目标实体
-