the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "net.minecraft.world.entity.ai.control.h"
3#include "net.minecraft.world.entity.ai.navigation.h"
4#include "net.minecraft.world.entity.ai.util.h"
5#include "net.minecraft.world.entity.h"
6#include "net.minecraft.world.phys.h"
7#include "PanicGoal.h"
8
9PanicGoal::PanicGoal(PathfinderMob *mob, double speedModifier)
10{
11 this->mob = mob;
12 this->speedModifier = speedModifier;
13 setRequiredControlFlags(Control::MoveControlFlag);
14}
15
16bool PanicGoal::canUse()
17{
18 if (mob->getLastHurtByMob() == NULL && !mob->isOnFire()) return false;
19 Vec3 *pos = RandomPos::getPos(dynamic_pointer_cast<PathfinderMob>(mob->shared_from_this()), 5, 4);
20 if (pos == NULL) return false;
21 posX = pos->x;
22 posY = pos->y;
23 posZ = pos->z;
24 return true;
25}
26
27void PanicGoal::start()
28{
29 mob->getNavigation()->moveTo(posX, posY, posZ, speedModifier);
30}
31
32bool PanicGoal::canContinueToUse()
33{
34 return !mob->getNavigation()->isDone();
35}