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.h"
3#include "net.minecraft.world.entity.ai.control.h"
4#include "net.minecraft.world.entity.ai.navigation.h"
5#include "FloatGoal.h"
6
7FloatGoal::FloatGoal(Mob *mob)
8{
9 this->mob = mob;
10 setRequiredControlFlags(Control::JumpControlFlag);
11 mob->getNavigation()->setCanFloat(true);
12}
13
14bool FloatGoal::canUse()
15{
16 return (mob->isInWater() || mob->isInLava());
17}
18
19void FloatGoal::tick()
20{
21 if (mob->getRandom()->nextFloat() < 0.8f) mob->getJumpControl()->jump();
22}