Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

How to implement baritone Api to forge mod?

Philip2809 opened this issue ยท 43 comments

commented

What do you need help with?

How to implement baritone Api to forge mod? I am new to forge modding and java.

Final checklist

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

Hi,
I read the Readme but it just included what commands you can add when you have imported the mod.

My build.gradle looks completely different, and when I add the compile stuff I just get errors that it can't find the files on the forgemodding site. Is this becuase it's a new version? I even tried to put the api jar in the folder it told me.

Here is the error:
Could not resolve all files for configuration ':compileClasspath'.

Could not find cabaletta:baritone-api:1.6.1.
Searched in the following locations:
- https://files.minecraftforge.net/maven/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- https://files.minecraftforge.net/maven/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- file:/D:/Users/Philip/.gradle/caches/forge_gradle/bundeled_repo/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- file:/D:/Users/Philip/.gradle/caches/forge_gradle/bundeled_repo/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- https://libraries.minecraft.net/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- https://repo.maven.apache.org/maven2/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- https://repo.maven.apache.org/maven2/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
Required by:
project :

Possible solution:

Any way to solve this, if so how?

commented

You forgot to add the impact maven repo to your deps

My build.gradle looks completely different

Well no shit, you're supposed to reimplement the diffs which I presented (in green!!)

files.minecraftforge.net/maven/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar

Baritone isn't a forge dependency, see above

commented

Ok, I added they maven but I don't understand what you mean by reimplementing diffs? Whenever i use "shadowJar" it crashes immediately. The error after I added everything I could that was green is:

Could not resolve all files for configuration ':compileClasspath'.

Could not find cabaletta:baritone-api:1.6.1.
Searched in the following locations:
- http://repo.spongepowered.org/maven/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- http://repo.spongepowered.org/maven/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- https://impactdevelopment.github.io/maven/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- https://impactdevelopment.github.io/maven/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- http://maven-eclipse.github.io/maven/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- http://maven-eclipse.github.io/maven/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- https://jitpack.io/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- https://jitpack.io/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- https://repo.maven.apache.org/maven2/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- https://repo.maven.apache.org/maven2/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- https://jcenter.bintray.com/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- https://jcenter.bintray.com/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- https://files.minecraftforge.net/maven/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- https://files.minecraftforge.net/maven/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- file:/D:/Users/Philip/.gradle/caches/forge_gradle/bundeled_repo/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- file:/D:/Users/Philip/.gradle/caches/forge_gradle/bundeled_repo/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- https://libraries.minecraft.net/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
- https://repo.maven.apache.org/maven2/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.pom
- https://repo.maven.apache.org/maven2/cabaletta/baritone-api/1.6.1/baritone-api-1.6.1.jar
Required by:
project :

Possible solution:

What I am doing wrong?

commented

You should be doing 1.6, not 1.6.1

commented

You compile the 1.6 api but the 1.6.1 baritone

commented

image
I specifically linked this for a reason

commented

Ok thanks I got it running but how do I add the baritoneAPI.getProvider()...etc

commented

What?

commented

I got it running the game but how do I import to be able to do this:
BaritoneAPI.getSettings().allowSprint.value = true;
BaritoneAPI.getSettings().primaryTimeoutMS.value = 2000L;

commented

Import the correct class

commented

did I forget someting?

commented

import baritone.api.BaritoneAPI;
does not work for me

commented

You need to reimport as it's probably not in your classpath

commented

dumb qustion (the one before), where is the path to the baritone-api.jar?

commented

is it a problem that I am using Intellij?

commented

sorry that i am an idiot how do I do that?

Press ๐Ÿ”„

commented

image

commented

No.

where is the path to the baritone-api.jar?

Why??

commented

Found the refresh button, it was hidden in some tab to the left. Thanks for helping me out!

commented

Sorry to bother you, ran into some problems.
When I run it with both baritone and baritone api it says Exception in thread "main"
When I run it with only the api I get a mixin error, I have never done anyting in a mixin, is that someting I need to fix?

commented

Yes, you need to register the Baritone mixins

commented

How and where do I do that? I added the 'MixinConfigs': mixins.baritone.json' to the gradle (same errors as before)? And when I run it sould I use only the API or both?

commented

You need the forge mixin whatever. I linked commits to the example

commented

I can't get it to work, it does not find the IFMLLoadingPlugin

commented

You need to add it to your mixin loader

commented

I have no idea how to do that and when I try to find info about it it's about fabric and events. Is it with the @mixin thing?

commented

I have found that one and tried to make is as good as I could but it just can't find "IFMLLoadingPlugin" And all my @OVERRIDES turn red i have honestly no idea why

commented

You need to reimport your project then

commented

image
I have reimported and reloaded the project, could it have been renamed?

commented

If you updated it, yes. Don't write imports manually.

commented

I closed the project the cleared the cashce and that started to import some things when I reopned the project. I Usally don't write them manually but I wanted to how that there is nothing on that path.

commented

Do you have any ideas of how to find the name of it?

Idk guess lmao

What happens if you done use IFMLLoadingPlugin?

Baritone won't load it's Mixins if you want to include Baritone

commented

Do you have any idea what I sould do? Trying to find if it has a new name

commented

Let your IDE handle your imports for you

commented

image
It finds the path, net.minecraftforge.fml.relauncher.IFMLLoadingPlugin but it still is red
Could the name be "FMLLOADER"? And is this IFMLLoadingPlugin a must have?

commented

You probably have the wrong name

commented

Do you have any ideas of how to find the name of it?

commented

What happens if you done use IFMLLoadingPlugin?

commented

Hi, I tried to ask on the maker of that package, on minecraft forge modding support but there were rude and didn't wanna help me, so I guess I will have to figure it out somehow. Btw I am allowed to clone that client project you did and see what you did different and if I have missed something?

commented

I mean yea. It's LGPLv3

commented

He was trying to add it to a 1.16 mod not 1.12.2
And theres no IFMLLoadingPlugin in 1.16