Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

How can i use the api to add a new own command in my fabric mod

MGThorn opened this issue ยท 1 comments

commented

is there a tutorial or exaple class/classes for 1.19.0?
i have already implemented a maven repo of baritone to the build.gradle (i am using one from meteor hack client)
but now i am not sure how to add a command i could copy the code from lets say waypoints into my own class and modify it but then it would not be added to the command list i am guessing?
do i need a mixin to insert code into the CommandManager or is there any other way (like the api) ?

commented

found a solution

  1. make a new class (newCommand) copy a code of a command from baritone/command/defaults/THECOMMAND and edit the different methods to do what you like
  2. go to your Entry point class in your own mod and appaned the following code in the onInitialize() method

NewCommand newCommand = new NewCommand (BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().getBaritone()); BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().getRegistry().register(newCommand);