Package cn.nukkit.entity.ai.executor
Class SleepOnOwnerBedExecutor
java.lang.Object
cn.nukkit.entity.ai.executor.SleepOnOwnerBedExecutor
- All Implemented Interfaces:
IBehaviorExecutor
@PowerNukkitXOnly
@Since("1.19.50-r3")
public class SleepOnOwnerBedExecutor
extends Object
implements IBehaviorExecutor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
execute
(EntityIntelligent entity) 调度器将会持续执行此执行器,直到返回false,或者执行器被中断
此方法每gt都会调用void
onInterrupt
(EntityIntelligent entity) 行为非正常中断时(例如被更高级行为覆盖)调用void
onStart
(EntityIntelligent entity) 行为评估成功后,进入激活状态前调用void
onStop
(EntityIntelligent entity) 行为正常结束时(execute()方法返回false)调用protected void
setSleeping
(EntityIntelligent entity, boolean sleeping) protected void
stop
(EntityIntelligent entity)
-
Constructor Details
-
SleepOnOwnerBedExecutor
public SleepOnOwnerBedExecutor()
-
-
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
-
onStart
Description copied from interface:IBehaviorExecutor
行为评估成功后,进入激活状态前调用After the behavior evaluation is successful, it is called before entering the active state
- Specified by:
onStart
in interfaceIBehaviorExecutor
- Parameters:
entity
- 目标实体
-
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
- 目标实体
-
onStop
Description copied from interface:IBehaviorExecutor
行为正常结束时(execute()方法返回false)调用Called when the behavior ends normally (the execute() method returns false)
- Specified by:
onStop
in interfaceIBehaviorExecutor
- Parameters:
entity
- 目标实体
-
stop
-
setSleeping
-