Package cn.nukkit.entity.ai.executor
Class EatGrassExecutor
java.lang.Object
cn.nukkit.entity.ai.executor.EatGrassExecutor
- All Implemented Interfaces:
IBehaviorExecutor
@PowerNukkitXOnly
@Since("1.6.0.0-PNX")
public class EatGrassExecutor
extends Object
implements IBehaviorExecutor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
execute
(EntityIntelligent entity) 调度器将会持续执行此执行器,直到返回false,或者执行器被中断
此方法每gt都会调用void
onInterrupt
(EntityIntelligent entity) 行为非正常中断时(例如被更高级行为覆盖)调用protected void
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.IBehaviorExecutor
onStart, onStop
-
Field Details
-
duration
protected int duration -
currentTick
protected int currentTick
-
-
Constructor Details
-
EatGrassExecutor
public EatGrassExecutor(int duration)
-
-
Method Details
-
execute
Description copied from interface:IBehaviorExecutor
调度器将会持续执行此执行器,直到返回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- Specified by:
execute
in interfaceIBehaviorExecutor
- Parameters:
entity
- 执行目标实体- Returns:
- boolean
-
onInterrupt
Description copied from interface:IBehaviorExecutor
行为非正常中断时(例如被更高级行为覆盖)调用Called when behavior breaks abnormally (e.g. overridden by higher-level behavior)
- Specified by:
onInterrupt
in interfaceIBehaviorExecutor
- Parameters:
entity
- 目标实体
-
playEatGrassAnimation
-