Package cn.nukkit.entity.ai.executor
Class WolfAttackExecutor
java.lang.Object
cn.nukkit.entity.ai.executor.MeleeAttackExecutor
cn.nukkit.entity.ai.executor.WolfAttackExecutor
- All Implemented Interfaces:
EntityControl
,IBehaviorExecutor
狼执行攻击,会带有狼的动画,以及攻击过程中狼还会看向携带食物的玩家.
The wolf performs an attack with a wolf animation, as well as during the attack the wolf will also look at the player carrying food.
-
Field Summary
Fields inherited from class cn.nukkit.entity.ai.executor.MeleeAttackExecutor
attackTick, clearDataWhenLose, coolDown, lookTarget, maxSenseRangeSquared, memory, oldTarget, speed, target
-
Constructor Summary
ConstructorDescriptionWolfAttackExecutor
(MemoryType<? extends Entity> memory, float speed, int maxSenseRange, boolean clearDataWhenLose, int coolDown) -
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.MeleeAttackExecutor
playAttackAnimation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cn.nukkit.entity.ai.executor.EntityControl
removeLookTarget, removeRouteTarget, setLookTarget, setRouteTarget
Methods inherited from interface cn.nukkit.entity.ai.executor.IBehaviorExecutor
onStart
-
Constructor Details
-
WolfAttackExecutor
public WolfAttackExecutor(MemoryType<? extends Entity> memory, float speed, int maxSenseRange, boolean clearDataWhenLose, int coolDown)
-
-
Method Details
-
execute
Description copied from interface:IBehaviorExecutor
调度器将会持续执行此执行器,直到返回false,或者执行器被中断
此方法每gt都会调用- Specified by:
execute
in interfaceIBehaviorExecutor
- Overrides:
execute
in classMeleeAttackExecutor
- Parameters:
entity
- 执行目标实体- Returns:
- boolean
-
onStop
Description copied from interface:IBehaviorExecutor
行为正常结束时(execute()方法返回false)调用- Specified by:
onStop
in interfaceIBehaviorExecutor
- Overrides:
onStop
in classMeleeAttackExecutor
- Parameters:
entity
- 目标实体
-
onInterrupt
Description copied from interface:IBehaviorExecutor
行为非正常中断时(例如被更高级行为覆盖)调用- Specified by:
onInterrupt
in interfaceIBehaviorExecutor
- Overrides:
onInterrupt
in classMeleeAttackExecutor
- Parameters:
entity
- 目标实体
-