Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

how to pause with api

RifqiZT opened this issue ยท 1 comments

commented

What do you need help with?

I'm trying to make autoeat with baritone, basically if food level below certain level it will pause the current pathing, after food level above certain level, resume.
like this:
if currentBaritone.getPathingBehavior().isPathing() && player.getHungerManager().getFoodLevel() < minFoodLevel
execute pause
else resume

tried getCommandManager().execute("pause") and gave me 'cannot access avr'
there is pathingCommandType.REQUEST_PAUSE but cannot get it to work.

Final checklist

  • I know how to properly use check boxes
  • I have not used any OwO's or UwU's in this issue.
commented

tried getCommandManager().execute("pause") and gave me 'cannot access avr'

That looks like a problem with your setup (obfuscation mismatch). How to resolve that depends on your the game version and mod loader.

To properly pause Baritone you should implement a process which can then return false from isActive normally and when your autoeat wants to eat the process would switch to isActive returning true and onTick returning a pathing command with type REQUEST_PAUSE.