if (ai instanceof AIRobotFetchAndEquipItemStack) {
if (robot.getHeldItem() == null) {
startDelegateAI(new AIRobotGotoSleep(robot));
}
} else if (ai instanceof AIRobotSearchEntity) {
AIRobotSearchEntity mobAI = (AIRobotSearchEntity) ai;
if (mobAI.target != null) {
startDelegateAI(new AIRobotAttack(robot, ((AIRobotSearchEntity) ai).target));
} else {
startDelegateAI(new AIRobotGotoSleep(robot));